Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta raft log storage impl #6

Draft
wants to merge 7 commits into
base: mainline
Choose a base branch
from

Conversation

siennathesane
Copy link
Contributor

  • added tvec! macro
  • fixed error hierarchy
  • fixed mutability in traits
  • added vote support

@siennathesane siennathesane self-assigned this Sep 5, 2024
@siennathesane siennathesane changed the title started work on meta raft log storage impl meta raft log storage impl Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

Benchmark Results

running 33 tests
test storage::db::tests::open_blank_db ... ignored
test storage::db::tests::open_existing_column ... ignored
test storage::db::tests::put_and_get_and_delete ... ignored
test storage::db::tests::test_append_success ... ignored
test storage::db::tests::test_get_last_applied_log_missing_column_family ... ignored
test storage::db::tests::test_get_last_applied_log_success ... ignored
test storage::db::tests::test_get_last_purged_log_missing_column_family ... ignored
test storage::db::tests::test_get_last_purged_log_success ... ignored
test storage::db::tests::test_get_log_state_missing_column_family ... ignored
test storage::db::tests::test_get_log_state_missing_log_state ... ignored
test storage::db::tests::test_get_log_state_success ... ignored
test storage::db::tests::test_get_membership_missing_column_family ... ignored
test storage::db::tests::test_get_membership_success ... ignored
test storage::db::tests::test_purge_missing_column_family ... ignored
test storage::db::tests::test_purge_missing_log_id ... ignored
test storage::db::tests::test_purge_success ... ignored
test storage::db::tests::test_read_vote_decoding_error ... ignored
test storage::db::tests::test_read_vote_missing_column_family ... ignored
test storage::db::tests::test_read_vote_missing_vote ... ignored
test storage::db::tests::test_read_vote_success ... ignored
test storage::db::tests::test_save_vote_encoding_error ... ignored
test storage::db::tests::test_save_vote_missing_column_family ... ignored
test storage::db::tests::test_save_vote_success ... ignored
test storage::db::tests::test_set_last_applied_log_missing_column_family ... ignored
test storage::db::tests::test_set_last_applied_log_success ... ignored
test storage::db::tests::test_set_last_purged_log_missing_column_family ... ignored
test storage::db::tests::test_set_last_purged_log_success ... ignored
test storage::db::tests::test_set_membership_missing_column_family ... ignored
test storage::db::tests::test_set_membership_success ... ignored
test storage::db::tests::test_vote_lifecycle ... ignored
test storage::memcache::tests::put_and_get_and_delete ... ignored
test utils::math::tests::divide_into_buckets_test ... ignored
test utils::math::tests::test_between ... ignored

test result: ok. 0 passed; 0 failed; 33 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

disk engine/disk engine put/1024
                        time:   [14.410 µs 14.451 µs 14.507 µs]
                        thrpt:  [67.315 MiB/s 67.577 MiB/s 67.768 MiB/s]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
disk engine/disk engine get/1024
                        time:   [8.7903 µs 8.8047 µs 8.8242 µs]
                        thrpt:  [110.67 MiB/s 110.91 MiB/s 111.10 MiB/s]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) high mild
  3 (3.00%) high severe
disk engine/disk engine delete/1024
                        time:   [14.192 µs 14.200 µs 14.208 µs]
                        thrpt:  [68.731 MiB/s 68.773 MiB/s 68.812 MiB/s]
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) low mild
  4 (4.00%) high mild
  1 (1.00%) high severe
disk engine/disk engine put/2048
                        time:   [14.370 µs 14.386 µs 14.405 µs]
                        thrpt:  [135.59 MiB/s 135.77 MiB/s 135.92 MiB/s]
Found 11 outliers among 100 measurements (11.00%)
  4 (4.00%) high mild
  7 (7.00%) high severe
disk engine/disk engine get/2048
                        time:   [8.8162 µs 8.8226 µs 8.8298 µs]
                        thrpt:  [221.20 MiB/s 221.38 MiB/s 221.54 MiB/s]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe
disk engine/disk engine delete/2048
                        time:   [14.226 µs 14.255 µs 14.290 µs]
                        thrpt:  [136.68 MiB/s 137.01 MiB/s 137.29 MiB/s]
Found 15 outliers among 100 measurements (15.00%)
  1 (1.00%) low mild
  6 (6.00%) high mild
  8 (8.00%) high severe
disk engine/disk engine put/4096
                        time:   [14.427 µs 14.443 µs 14.464 µs]
                        thrpt:  [270.06 MiB/s 270.45 MiB/s 270.77 MiB/s]
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
  5 (5.00%) high severe
disk engine/disk engine get/4096
                        time:   [8.8239 µs 8.8463 µs 8.8800 µs]
                        thrpt:  [439.89 MiB/s 441.57 MiB/s 442.69 MiB/s]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
disk engine/disk engine delete/4096
                        time:   [14.241 µs 14.387 µs 14.651 µs]
                        thrpt:  [266.62 MiB/s 271.52 MiB/s 274.30 MiB/s]
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) low mild
  3 (3.00%) high mild
  6 (6.00%) high severe
disk engine/disk engine put/8192
                        time:   [14.567 µs 14.612 µs 14.667 µs]
                        thrpt:  [532.64 MiB/s 534.66 MiB/s 536.32 MiB/s]
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high severe
disk engine/disk engine get/8192
                        time:   [8.8823 µs 8.9093 µs 8.9421 µs]
                        thrpt:  [873.67 MiB/s 876.89 MiB/s 879.56 MiB/s]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
disk engine/disk engine delete/8192
                        time:   [14.314 µs 14.331 µs 14.348 µs]
                        thrpt:  [544.49 MiB/s 545.15 MiB/s 545.79 MiB/s]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
disk engine/disk engine put/16384
                        time:   [14.471 µs 14.503 µs 14.545 µs]
                        thrpt:  [1.0491 GiB/s 1.0521 GiB/s 1.0545 GiB/s]
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
  5 (5.00%) high severe
disk engine/disk engine get/16384
                        time:   [8.8414 µs 8.8617 µs 8.8886 µs]
                        thrpt:  [1.7167 GiB/s 1.7219 GiB/s 1.7258 GiB/s]
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe
disk engine/disk engine delete/16384
                        time:   [14.374 µs 14.427 µs 14.508 µs]
                        thrpt:  [1.0517 GiB/s 1.0577 GiB/s 1.0616 GiB/s]
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
  4 (4.00%) high severe
disk engine/disk engine put/32768
                        time:   [14.465 µs 14.507 µs 14.557 µs]
                        thrpt:  [2.0964 GiB/s 2.1037 GiB/s 2.1097 GiB/s]
Found 9 outliers among 100 measurements (9.00%)
  1 (1.00%) high mild
  8 (8.00%) high severe
disk engine/disk engine get/32768
                        time:   [8.8489 µs 8.8621 µs 8.8809 µs]
                        thrpt:  [3.4363 GiB/s 3.4436 GiB/s 3.4487 GiB/s]
Found 6 outliers among 100 measurements (6.00%)
  2 (2.00%) high mild
  4 (4.00%) high severe
disk engine/disk engine delete/32768
                        time:   [14.239 µs 14.266 µs 14.304 µs]
                        thrpt:  [2.1334 GiB/s 2.1391 GiB/s 2.1433 GiB/s]
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe

write back cache storage/cache put/1024
                        time:   [16.140 µs 16.154 µs 16.172 µs]
                        thrpt:  [60.387 MiB/s 60.454 MiB/s 60.506 MiB/s]
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) low mild
  2 (2.00%) high mild
  4 (4.00%) high severe
write back cache storage/cache get/1024
                        time:   [294.83 ns 305.73 ns 314.87 ns]
                        thrpt:  [3.0288 GiB/s 3.1193 GiB/s 3.2346 GiB/s]
Found 8 outliers among 100 measurements (8.00%)
  8 (8.00%) high mild
write back cache storage/cache delete/1024
                        time:   [3.4668 µs 3.6641 µs 3.9185 µs]
                        thrpt:  [249.22 MiB/s 266.52 MiB/s 281.69 MiB/s]
Found 16 outliers among 100 measurements (16.00%)
  16 (16.00%) high mild
write back cache storage/cache put/2048
                        time:   [16.216 µs 16.228 µs 16.242 µs]
                        thrpt:  [120.25 MiB/s 120.35 MiB/s 120.44 MiB/s]
Found 6 outliers among 100 measurements (6.00%)
  5 (5.00%) high mild
  1 (1.00%) high severe
write back cache storage/cache get/2048
                        time:   [296.98 ns 307.79 ns 316.84 ns]
                        thrpt:  [6.0199 GiB/s 6.1969 GiB/s 6.4224 GiB/s]
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild
write back cache storage/cache delete/2048
                        time:   [3.5152 µs 3.7141 µs 3.9681 µs]
                        thrpt:  [492.21 MiB/s 525.87 MiB/s 555.63 MiB/s]
Found 16 outliers among 100 measurements (16.00%)
  16 (16.00%) high mild
write back cache storage/cache put/4096
                        time:   [16.266 µs 16.310 µs 16.367 µs]
                        thrpt:  [238.66 MiB/s 239.50 MiB/s 240.15 MiB/s]
Found 6 outliers among 100 measurements (6.00%)
  1 (1.00%) high mild
  5 (5.00%) high severe
write back cache storage/cache get/4096
                        time:   [306.84 ns 319.32 ns 329.68 ns]
                        thrpt:  [11.571 GiB/s 11.946 GiB/s 12.432 GiB/s]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) high mild
write back cache storage/cache delete/4096
                        time:   [3.4759 µs 3.6761 µs 3.9362 µs]
                        thrpt:  [992.40 MiB/s 1.0377 GiB/s 1.0975 GiB/s]
Found 16 outliers among 100 measurements (16.00%)
  16 (16.00%) high mild
write back cache storage/cache put/8192
                        time:   [16.208 µs 16.222 µs 16.237 µs]
                        thrpt:  [481.15 MiB/s 481.61 MiB/s 482.03 MiB/s]
Found 8 outliers among 100 measurements (8.00%)
  6 (6.00%) high mild
  2 (2.00%) high severe
write back cache storage/cache get/8192
                        time:   [304.81 ns 316.82 ns 326.92 ns]
                        thrpt:  [23.337 GiB/s 24.081 GiB/s 25.030 GiB/s]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
write back cache storage/cache delete/8192
                        time:   [3.4869 µs 3.6860 µs 3.9429 µs]
                        thrpt:  [1.9350 GiB/s 2.0698 GiB/s 2.1880 GiB/s]
Found 16 outliers among 100 measurements (16.00%)
  16 (16.00%) high mild
write back cache storage/cache put/16384
                        time:   [16.268 µs 16.327 µs 16.400 µs]
                        thrpt:  [952.74 MiB/s 957.03 MiB/s 960.47 MiB/s]
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) high mild
  6 (6.00%) high severe
write back cache storage/cache get/16384
                        time:   [300.15 ns 311.49 ns 320.98 ns]
                        thrpt:  [47.538 GiB/s 48.986 GiB/s 50.837 GiB/s]
Found 6 outliers among 100 measurements (6.00%)
  6 (6.00%) high mild
write back cache storage/cache delete/16384
                        time:   [3.4883 µs 3.6885 µs 3.9467 µs]
                        thrpt:  [3.8662 GiB/s 4.1369 GiB/s 4.3743 GiB/s]
Found 16 outliers among 100 measurements (16.00%)
  16 (16.00%) high mild
write back cache storage/cache put/32768
                        time:   [16.240 µs 16.284 µs 16.345 µs]
                        thrpt:  [1.8671 GiB/s 1.8741 GiB/s 1.8792 GiB/s]
Found 12 outliers among 100 measurements (12.00%)
  1 (1.00%) low severe
  2 (2.00%) high mild
  9 (9.00%) high severe
write back cache storage/cache get/32768
                        time:   [309.46 ns 322.24 ns 332.89 ns]
                        thrpt:  [91.676 GiB/s 94.704 GiB/s 98.617 GiB/s]
Found 6 outliers among 100 measurements (6.00%)
  6 (6.00%) high mild
write back cache storage/cache delete/32768
                        time:   [3.4748 µs 3.6737 µs 3.9291 µs]
                        thrpt:  [7.7671 GiB/s 8.3070 GiB/s 8.7826 GiB/s]
Found 16 outliers among 100 measurements (16.00%)
  16 (16.00%) high mild

Possible Bugs

src/storage/memcache.rs:179:9: replace <impl MetaRaftLogStorage for WriteBackCache>::read_vote -> Result<Option<Vote>, StorageError> with Ok(Some(Default::default()))
src/storage/memcache.rs:376:9: replace <impl Expiry for VoteCache>::expire_after_update -> Option<Duration> with Some(Default::default())
src/storage/memcache.rs:82:9: replace <impl Expiry for WriteBackCache>::expire_after_create -> Option<Duration> with None
src/storage/memcache.rs:376:9: replace <impl Expiry for VoteCache>::expire_after_update -> Option<Duration> with None
src/storage/memcache.rs:82:9: replace <impl Expiry for WriteBackCache>::expire_after_create -> Option<Duration> with Some(Default::default())
src/storage/db.rs:522:76: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::truncate
src/utils/disk.rs:24:5: replace clear_tmp_dir -> Result<(), std::io::Error> with Ok(())
src/storage/db.rs:556:76: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::purge
src/storage/memcache.rs:118:9: replace <impl MetaKeyValueStore for WriteBackCache>::get -> Result<KeyValuePair, StorageError> with Ok(Default::default())
src/storage/db.rs:522:58: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::truncate
src/storage/db.rs:550:76: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::purge
src/storage/db.rs:488:62: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::append
src/storage/db.rs:488:62: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::append
src/storage/memcache.rs:366:9: replace <impl Expiry for VoteCache>::expire_after_read -> Option<Duration> with Some(Default::default())
src/storage/db.rs:550:58: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::purge
src/storage/memcache.rs:205:9: replace <impl MetaRaftLogStorage for WriteBackCache>::append -> Result<(), StorageError> with Ok(())
src/storage/db.rs:550:76: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::purge
src/storage/memcache.rs:355:9: replace <impl Expiry for VoteCache>::expire_after_create -> Option<Duration> with None
src/storage/db.rs:608:9: replace <impl MetaKeyValueStore for DiskStorage>::delete -> Result<(), StorageError> with Ok(())
src/storage/db.rs:522:58: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::truncate
src/storage/db.rs:339:9: replace <impl MetaRaftStateMachine for DiskStorage>::applied_state -> std::result::Result<(Option<LogId>, StoredMembership), StorageError> with Ok((None, Default::default()))
src/storage/memcache.rs:355:9: replace <impl Expiry for VoteCache>::expire_after_create -> Option<Duration> with Some(Default::default())
src/storage/db.rs:528:76: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::truncate
src/storage/db.rs:488:80: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::append
src/storage/db.rs:509:9: replace <impl MetaRaftLogStorage for DiskStorage>::truncate -> Result<(), StorageError> with Ok(())
src/storage/db.rs:556:58: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::purge
src/storage/db.rs:528:58: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::truncate
src/storage/db.rs:528:76: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::truncate
src/storage/db.rs:488:80: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::append
src/storage/memcache.rs:366:9: replace <impl Expiry for VoteCache>::expire_after_read -> Option<Duration> with None
src/storage/memcache.rs:162:9: replace <impl MetaRaftLogStorage for WriteBackCache>::get_log_state -> Result<LogState, StorageError> with Ok(Default::default())
src/storage/memcache.rs:179:9: replace <impl MetaRaftLogStorage for WriteBackCache>::read_vote -> Result<Option<Vote>, StorageError> with Ok(None)
src/storage/db.rs:522:76: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::truncate
src/storage/memcache.rs:167:9: replace <impl MetaRaftLogStorage for WriteBackCache>::save_vote -> Result<(), StorageError> with Ok(())
src/storage/memcache.rs:215:9: replace <impl MetaRaftLogStorage for WriteBackCache>::purge -> Result<(), StorageError> with Ok(())
src/storage/memcache.rs:210:9: replace <impl MetaRaftLogStorage for WriteBackCache>::truncate -> Result<(), StorageError> with Ok(())
src/storage/db.rs:339:9: replace <impl MetaRaftStateMachine for DiskStorage>::applied_state -> std::result::Result<(Option<LogId>, StoredMembership), StorageError> with Ok((Some(Default::default()), Default::default()))
src/storage/db.rs:556:58: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::purge
src/storage/db.rs:556:76: replace + with * in <impl MetaRaftLogStorage for DiskStorage>::purge
src/storage/db.rs:550:58: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::purge
src/storage/db.rs:571:9: replace <impl MetaKeyValueStore for DiskStorage>::get -> Result<KeyValuePair, StorageError> with Ok(Default::default())
src/storage/memcache.rs:153:9: replace <impl MetaKeyValueStore for WriteBackCache>::delete -> Result<(), StorageError> with Ok(())
src/storage/db.rs:620:9: replace <impl Drop for DiskStorage>::drop with ()
src/storage/db.rs:528:58: replace + with - in <impl MetaRaftLogStorage for DiskStorage>::truncate

* added tvec! macro
* fixed error hierarchy
* fixed mutability in traits
* added vote support

Signed-off-by: Sienna Lloyd <sienna@linux.com>
* ran `cargo fmt`
* silenced unused warnings for now
* added contributing (mostly for me)
* fixed cargo config
* added debug traits to errors
* extracted caches to separate structs for clarity
* swapped away from TransactionDB (sad)
* laid basic groundwork for configs (todo)
Signed-off-by: Sienna Lloyd <sienna@linux.com>
Signed-off-by: Sienna Lloyd <sienna@linux.com>
Copy link

codecov bot commented Sep 6, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@siennathesane siennathesane force-pushed the feat/metaraftlogstorage branch 14 times, most recently from 2fa0c04 to b217f15 Compare September 10, 2024 01:44
Signed-off-by: Sienna Lloyd <sienna@linux.com>
Signed-off-by: Sienna Lloyd <sienna@linux.com>
* adds MetaRaftStateMachine trait with methods for state machine operations
* implements MetaRaftStateMachine for DiskStorage
* adds methods for managing last applied log and membership
* expands test coverage for new functionality
* increases SYSTEM_SHARD_RANGE_STOP from 100 to 1000

Signed-off-by: Sienna Satterwhite <sienna@linux.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant