mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-10 11:44:22 +01:00
Merge 'core/mvcc: Rename "-lg" to "-log"' from Pekka Enberg
The "lg" name is just weird. Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #3554
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -48,4 +48,4 @@ simulator-output/
|
||||
bisected.sql
|
||||
*.log
|
||||
|
||||
*.db-lg
|
||||
*.db-log
|
||||
|
||||
@@ -410,7 +410,7 @@ impl Database {
|
||||
let shared_wal = WalFileShared::open_shared_if_exists(&io, wal_path)?;
|
||||
|
||||
let mv_store = if opts.enable_mvcc {
|
||||
let file = io.open_file(&format!("{path}-lg"), OpenFlags::default(), false)?;
|
||||
let file = io.open_file(&format!("{path}-log"), OpenFlags::default(), false)?;
|
||||
let storage = mvcc::persistent_storage::Storage::new(file);
|
||||
let mv_store = MvStore::new(mvcc::LocalClock::new(), storage);
|
||||
Some(Arc::new(mv_store))
|
||||
|
||||
@@ -58,7 +58,7 @@ impl MvccTestDbNoConn {
|
||||
let log_path_filename = log_path
|
||||
.file_name()
|
||||
.and_then(|name| name.to_str())
|
||||
.map(|s| format!("{s}-lg"))
|
||||
.map(|s| format!("{s}-log"))
|
||||
.unwrap();
|
||||
log_path.set_file_name(log_path_filename);
|
||||
Self {
|
||||
|
||||
@@ -480,7 +480,7 @@ fn test_mvcc_checkpoint_works() {
|
||||
conn.execute("COMMIT").unwrap();
|
||||
}
|
||||
|
||||
// Before checkpoint: assert that the DB file size is exactly 4096, .db-wal size is exactly 32, and there is a nonzero size .db-lg file
|
||||
// Before checkpoint: assert that the DB file size is exactly 4096, .db-wal size is exactly 32, and there is a nonzero size .db-log file
|
||||
let db_file_size = std::fs::metadata(&tmp_db.path).unwrap().len();
|
||||
assert!(db_file_size == 4096);
|
||||
let wal_file_size = std::fs::metadata(tmp_db.path.with_extension("db-wal"))
|
||||
@@ -490,7 +490,7 @@ fn test_mvcc_checkpoint_works() {
|
||||
wal_file_size == 0,
|
||||
"wal file size should be 0 bytes, but is {wal_file_size} bytes"
|
||||
);
|
||||
let lg_file_size = std::fs::metadata(tmp_db.path.with_extension("db-lg"))
|
||||
let lg_file_size = std::fs::metadata(tmp_db.path.with_extension("db-log"))
|
||||
.unwrap()
|
||||
.len();
|
||||
assert!(lg_file_size > 0);
|
||||
@@ -521,7 +521,7 @@ fn test_mvcc_checkpoint_works() {
|
||||
|
||||
assert_eq!(rows, expected);
|
||||
|
||||
// Assert that the db file size is larger than 4096, assert .db-wal size is 32 bytes, assert there is no .db-lg file
|
||||
// Assert that the db file size is larger than 4096, assert .db-wal size is 32 bytes, assert there is no .db-log file
|
||||
let db_file_size = std::fs::metadata(&tmp_db.path).unwrap().len();
|
||||
assert!(db_file_size > 4096);
|
||||
assert!(db_file_size % 4096 == 0);
|
||||
@@ -532,7 +532,7 @@ fn test_mvcc_checkpoint_works() {
|
||||
wal_size == 0,
|
||||
"wal size should be 0 bytes, but is {wal_size} bytes"
|
||||
);
|
||||
let log_size = std::fs::metadata(tmp_db.path.with_extension("db-lg"))
|
||||
let log_size = std::fs::metadata(tmp_db.path.with_extension("db-log"))
|
||||
.unwrap()
|
||||
.len();
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user