Skip to content

Commit 45aa03c

Browse files
author
Michael Rosenberg
committed
Remove swap_checkpoint
1 parent 107fdc9 commit 45aa03c

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

crates/generic_log_worker/src/log_ops.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ async fn sequence_entries<L: LogEntry>(
992992
// This is a critical error, since we don't know the state of the
993993
// checkpoint in the database at this point. Bail and let [SequenceState::load] get us
994994
// to a good state after restart.
995-
swap_checkpoint(lock, sequence_state.checkpoint(), &new_checkpoint)
995+
lock.swap(CHECKPOINT_KEY, sequence_state.checkpoint(), &new_checkpoint)
996996
.await
997997
.map_err(|e| {
998998
SequenceError::Fatal(format!("couldn't upload checkpoint to database: {e}"))
@@ -1356,20 +1356,6 @@ fn marshal_staged_uploads(
13561356
.collect::<Vec<_>>())
13571357
}
13581358

1359-
/// Does a compare-and-swap of checkpoints. Useful for updating a checkpoint
1360-
/// to include new cosignatures
1361-
///
1362-
/// # Errors
1363-
/// Errors when `old` doesn't match the current checkpoint, or if fetching or
1364-
/// setting storage failed.
1365-
pub(crate) async fn swap_checkpoint(
1366-
lock: &impl LockBackend,
1367-
old: &[u8],
1368-
new: &[u8],
1369-
) -> Result<(), WorkerError> {
1370-
lock.swap(CHECKPOINT_KEY, old, new).await
1371-
}
1372-
13731359
/// [`UploadOptions`] are used as part of the [`ObjectBackend::upload`] method, and are
13741360
/// marshaled to JSON and stored in the staging bundles.
13751361
#[derive(Debug, Default, Serialize, Clone, Deserialize)]

crates/generic_log_worker/src/sequencer_do.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -308,16 +308,6 @@ impl<L: LogEntry> GenericSequencer<L> {
308308
}
309309
}
310310

311-
/// Does a compare-and-swap of checkpoints. Useful for updating a checkpoint
312-
/// to include new cosignatures
313-
///
314-
/// # Errors
315-
/// Errors when `old` doesn't match the current checkpoint, or if fetching
316-
/// or setting storage failed.
317-
pub async fn swap_checkpoint(&self, old: &[u8], new: &[u8]) -> Result<(), WorkerError> {
318-
log_ops::swap_checkpoint(&self.do_state, old, new).await
319-
}
320-
321311
/// Returns an inclusion proof for the given leaf index
322312
///
323313
/// # Errors

0 commit comments

Comments
 (0)