Skip to content

Commit

Permalink
store: Minor touchup in writable
Browse files Browse the repository at this point in the history
  • Loading branch information
lutter committed Apr 12, 2022
1 parent 410e6d5 commit cfc3869
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions store/postgres/src/writable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ impl BlockTracker {
Request::Write { block_ptr, .. } => {
self.block = self.block.min(block_ptr.number - 1);
}
Request::Revert { block_ptr, .. } => {
Request::RevertTo { block_ptr, .. } => {
// `block_ptr` is the block pointer we are reverting _to_,
// and is not affected by the revert
self.revert = self.revert.min(block_ptr.number);
Expand All @@ -407,7 +407,7 @@ impl BlockTracker {
/// Return `true` if a write at this block will be visible, i.e., not
/// reverted by a previous queue entry
fn visible(&self, block_ptr: &BlockPtr) -> bool {
self.revert >= block_ptr.number
block_ptr.number <= self.revert
}
}

Expand All @@ -424,7 +424,7 @@ enum Request {
data_sources: Vec<StoredDynamicDataSource>,
deterministic_errors: Vec<SubgraphError>,
},
Revert {
RevertTo {
store: Arc<SyncStore>,
/// The subgraph head will be at this block pointer after the revert
block_ptr: BlockPtr,
Expand All @@ -451,7 +451,7 @@ impl Request {
data_sources,
deterministic_errors,
),
Request::Revert {
Request::RevertTo {
store,
block_ptr,
firehose_cursor,
Expand Down Expand Up @@ -651,7 +651,7 @@ impl Queue {
None
}
}
Request::Revert { .. } => None,
Request::RevertTo { .. } => None,
}
});

Expand Down Expand Up @@ -706,7 +706,7 @@ impl Queue {
}
}
}
Request::Revert { .. } => { /* nothing to do */ }
Request::RevertTo { .. } => { /* nothing to do */ }
}
map
},
Expand Down Expand Up @@ -752,7 +752,7 @@ impl Queue {
dds.extend(data_sources.clone());
}
}
Request::Revert { .. } => { /* nothing to do */ }
Request::RevertTo { .. } => { /* nothing to do */ }
}
dds
});
Expand Down Expand Up @@ -835,7 +835,7 @@ impl Writer {
Writer::Sync(store) => store.revert_block_operations(block_ptr_to, firehose_cursor),
Writer::Async(queue) => {
let firehose_cursor = firehose_cursor.map(|c| c.to_string());
let req = Request::Revert {
let req = Request::RevertTo {
store: queue.store.cheap_clone(),
block_ptr: block_ptr_to,
firehose_cursor,
Expand Down

0 comments on commit cfc3869

Please sign in to comment.