Skip to content

Commit

Permalink
Fix committed syntagm usagages
Browse files Browse the repository at this point in the history
* Fix single `t` occurences of `committed` syntagm

References

* [Comit, Comitment, Committed](https://www.merriam-webster.com/dictionary/committed)
* [Committed](https://dictionary.cambridge.org/dictionary/english/committed)
  • Loading branch information
a2xchip committed Mar 12, 2024
1 parent f3da77e commit ad21afe
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion bottomless/src/wal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl WalFrameHeader {
pub const SIZE: usize = 24;

/// In multi-page transactions, only the last page in the transaction contains
/// the size_after_transaction field. If it's zero, it means it's an uncommited
/// the size_after_transaction field. If it's zero, it means it's an uncommitted
/// page.
pub fn is_committed(&self) -> bool {
self.size_after() != 0
Expand Down
4 changes: 2 additions & 2 deletions libsql-replication/proto/replication_log.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ message HelloResponse {
uint64 generation_start_index = 2;
/// id of the replicated log
string log_id = 3;
/// string-encoded Uuid v4 token for the current session, changes on each restart, and must be passed in subsequent requests header.string
/// string-encoded Uuid v4 token for the current session, changes on each restart, and must be passed in subsequent requests `header.string`
/// If the header session token fails to match the current session token, a NO_HELLO error is returned
bytes session_token = 4;
optional uint64 current_replication_index = 5;
Expand All @@ -28,7 +28,7 @@ message HelloResponse {
message Frame {
bytes data = 1;
// if this frames is a commit frame, then this can be set
// to the time when the transaction was commited
// to the time when the transaction was committed
optional int64 timestamp = 2;
}

Expand Down
4 changes: 2 additions & 2 deletions libsql-replication/src/generated/wal_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct HelloResponse {
/// / id of the replicated log
#[prost(string, tag = "3")]
pub log_id: ::prost::alloc::string::String,
/// / string-encoded Uuid v4 token for the current session, changes on each restart, and must be passed in subsequent requests header.string
/// / string-encoded Uuid v4 token for the current session, changes on each restart, and must be passed in subsequent requests `header.string`
/// / If the header session token fails to match the current session token, a NO_HELLO error is returned
#[prost(bytes = "bytes", tag = "4")]
pub session_token: ::prost::bytes::Bytes,
Expand All @@ -37,7 +37,7 @@ pub struct Frame {
#[prost(bytes = "bytes", tag = "1")]
pub data: ::prost::bytes::Bytes,
/// if this frames is a commit frame, then this can be set
/// to the time when the transaction was commited
/// to the time when the transaction was committed
#[prost(int64, optional, tag = "2")]
pub timestamp: ::core::option::Option<i64>,
}
Expand Down
2 changes: 1 addition & 1 deletion libsql-server/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub static REPLICATION_LATENCY: Lazy<Histogram> = Lazy::new(|| {
const NAME: &str = "libsql_server_replication_latency";
describe_counter!(
NAME,
"Latency between the time a transaction was commited on the primary and the commit frame was received by the replica"
"Latency between the time a transaction was committed on the primary and the commit frame was received by the replica"
);
register_histogram!(NAME)
});
Expand Down
20 changes: 10 additions & 10 deletions libsql-server/src/replication/primary/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub struct LogFile {
uncommitted_checksum: u64,

/// checksum of the last committed frame
commited_checksum: u64,
committed_checksum: u64,

/// Encryption layer
encryption: Option<FrameEncryptor>,
Expand Down Expand Up @@ -139,21 +139,21 @@ impl LogFile {
last_compact_instant: Instant::now(),
uncommitted_frame_count: 0,
uncommitted_checksum: 0,
commited_checksum: 0,
committed_checksum: 0,
encryption,
encryption_buf,
};

if file_end == 0 {
this.write_header()?;
} else if let Some(last_commited) = this.last_commited_frame_no() {
} else if let Some(last_committed) = this.last_committed_frame_no() {
// file is not empty, the starting checksum is the checksum from the last entry
let last_frame = this.frame(last_commited)?;
this.commited_checksum = last_frame.header().checksum.get();
let last_frame = this.frame(last_committed)?;
this.committed_checksum = last_frame.header().checksum.get();
this.uncommitted_checksum = last_frame.header().checksum.get();
} else {
// file contains no entry, start with the initial checksum from the file header.
this.commited_checksum = this.header.start_checksum.get();
this.committed_checksum = this.header.start_checksum.get();
this.uncommitted_checksum = this.header.start_checksum.get();
}

Expand All @@ -179,15 +179,15 @@ impl LogFile {
pub fn commit(&mut self) -> anyhow::Result<()> {
self.header.frame_count += self.uncommitted_frame_count.into();
self.uncommitted_frame_count = 0;
self.commited_checksum = self.uncommitted_checksum;
self.committed_checksum = self.uncommitted_checksum;
self.write_header()?;

Ok(())
}

pub(crate) fn rollback(&mut self) {
self.uncommitted_frame_count = 0;
self.uncommitted_checksum = self.commited_checksum;
self.uncommitted_checksum = self.committed_checksum;
}

pub fn write_header(&mut self) -> anyhow::Result<()> {
Expand Down Expand Up @@ -383,7 +383,7 @@ impl LogFile {
let new_header = LogFileHeader {
start_frame_no: (self.header.last_frame_no().unwrap() + 1).into(),
frame_count: 0.into(),
start_checksum: self.commited_checksum.into(),
start_checksum: self.committed_checksum.into(),
..self.header
};
new_log_file.header = new_header;
Expand Down Expand Up @@ -415,7 +415,7 @@ impl LogFile {
Ok(frame.into())
}

fn last_commited_frame_no(&self) -> Option<FrameNo> {
fn last_committed_frame_no(&self) -> Option<FrameNo> {
if self.header.frame_count.get() == 0 {
None
} else {
Expand Down
4 changes: 2 additions & 2 deletions libsql-server/src/replication/replicator_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ impl ReplicatorClient for Client {
match f.timestamp {
Some(ts_millis) => {
if let Some(ts_millis) = NaiveDateTime::from_timestamp_millis(ts_millis) {
let commited_at =
let committed_at =
DateTime::<Utc>::from_naive_utc_and_offset(ts_millis, Utc);
let lat = Utc::now() - commited_at;
let lat = Utc::now() - committed_at;
match lat.to_std() {
Ok(lat) => {
// we can record negative values if the clocks are out-of-sync. There is not
Expand Down
2 changes: 1 addition & 1 deletion libsql-sqlite3/doc/F2FS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Assumptions:
2. If the system fails before the F2FS_IOC_COMMIT_ATOMIC_WRITE is
completed, then following a reboot the database file is in the
state that it was in before F2FS_IOC_START_ATOMIC_WRITE was invoked.
Or, if the write was commited right before the system failed, in a
Or, if the write was committed right before the system failed, in a
state indicating that all write() calls were successfully committed
to persistent storage before the failure occurred.

Expand Down
2 changes: 1 addition & 1 deletion libsql-sqlite3/test/incrblob.test
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ unset -nocomplain ::text
#
# Then test that blob writes that take place inside of a
# transaction are not visible to external connections until
# after the transaction is commited and the blob channel
# after the transaction is committed and the blob channel
# closed.
#
# This test does not work with the "memsubsys1" configuration.
Expand Down
6 changes: 3 additions & 3 deletions libsql-sys/src/wal/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub unsafe extern "C" fn frames<T: Wal>(
size_after: u32,
is_commit: c_int,
sync_flags: c_int,
out_commited_frames: *mut c_int,
out_committed_frames: *mut c_int,
) -> c_int {
let this = &mut (*(wal as *mut T));
let mut headers = PageHeaders {
Expand All @@ -297,9 +297,9 @@ pub unsafe extern "C" fn frames<T: Wal>(
sync_flags,
) {
Ok(n) => {
if !out_commited_frames.is_null() {
if !out_committed_frames.is_null() {
unsafe {
*out_commited_frames = n as _;
*out_committed_frames = n as _;
}
}
SQLITE_OK
Expand Down
2 changes: 1 addition & 1 deletion libsql/src/local/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl Database {
let mut previous_fno = None;
loop {
let new_fno = self.sync_oneshot().await?;
tracing::trace!("New commited fno: {new_fno:?}");
tracing::trace!("New committed fno: {new_fno:?}");
if new_fno == previous_fno {
break;
} else {
Expand Down
2 changes: 1 addition & 1 deletion libsql/src/replication/local_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mod test {
use super::*;

#[tokio::test]
async fn snapshot_stream_commited() {
async fn snapshot_stream_committed() {
let tmp = tempdir().unwrap();
let snapshot = SnapshotFile::open("assets/test/snapshot.snap", None)
.await
Expand Down

0 comments on commit ad21afe

Please sign in to comment.