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

Remove Tokio requirement and move into a user supplied spawner #82

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

stevefan1999-personal
Copy link

@stevefan1999-personal stevefan1999-personal commented Sep 18, 2024

This PR is part of #80 to remove Tokio from the library crate itself. The test and everything else (including the API usage) should still work the same.

However, this is still a major interface change (added a new trait bound) so a semver change is also required.

Together with #81, this should make SurrealKV truly runtime-free, and should be able to seamlessly integrate with other async runtime (smol, async-std) as well.

@stevefan1999-personal
Copy link
Author

Tested on my WSL2 environment, all system go!

running 143 tests
test storage::cache::s3fifo::tests::test_push_and_read ... ok
test storage::cache::s3fifo::tests::test_push_removes_oldest ... ok
test storage::cache::s3fifo::tests::test_no_memory_leaks ... ok
test storage::kv::compaction::tests::test_recovery_state_sequentially ... ok
test storage::kv::entry::tests::encode_decode ... ok
test storage::kv::compaction::tests::insert_close_reopen_single_bulk_transaction ... ok
test storage::kv::entry::tests::txn_with_value_read_from_memory ... ok
test storage::kv::entry::tests::txn_with_value_read_from_clog ... ok
test storage::kv::compaction::tests::compact_skips_all_versions_if_last_is_deleted ... ok
test storage::kv::meta::tests::as_deleted ... ok
test storage::kv::meta::tests::bytes ... ok
test storage::kv::meta::tests::from_bytes ... ok
test storage::kv::meta::tests::new_metadata ... ok
test storage::kv::option::tests::default_options ... ok
test storage::kv::manifest::tests::test_manifest_append_and_load ... ok
test storage::kv::manifest::tests::test_add_and_read_multiple_manifests ... ok
test storage::kv::oracle::tests::waiters_new ... ok
test storage::kv::compaction::tests::compaction_with_all_keys_deleted ... ok
test storage::kv::compaction::tests::multiple_versions_stored_post_compaction ... ok
test storage::kv::oracle::tests::waiters_async ... ok
test storage::kv::compaction::tests::basic_compaction ... ok
test storage::kv::compaction::tests::compaction_with_sequential_writes_and_deletes ... ok
test storage::kv::compaction::tests::compaction_with_mixed_operations ... ok
test storage::kv::compaction::tests::compaction_with_overlapping_keys ... ok
test storage::kv::compaction::tests::compaction_persistence_across_restarts ... ok
test storage::kv::compaction::tests::compaction_with_random_keys_and_deletes ... ok
test storage::kv::compaction::tests::compaction_and_post_compaction_writes ... ok
test storage::kv::repair::tests::test_restore_files_multiple_clog_and_repair_files ... ok
test storage::kv::repair::tests::test_restore_files_multiple_clog_files ... ok
test storage::kv::repair::tests::test_restore_files_multiple_repair_files ... ok
test storage::kv::compaction::tests::compaction_with_random_reads_and_writes ... ok
test storage::kv::repair::tests::test_restore_files_multiple_repair_files_with_data ... ok
test storage::kv::repair::tests::test_restore_files_single_clog_and_repair_files ... ok
test storage::kv::reader::tests::reader ... ok
test storage::kv::compaction::tests::compact_handles_various_key_versions_correctly ... ok
test storage::kv::compaction::tests::multiple_versions_and_single_version_keys_post_compaction ... ok
test storage::kv::compaction::tests::compact_handles_various_key_versions_correctly_with_clear ... ok
test storage::kv::snapshot::tests::test_versioned_apis_with_snapshot ... ok
test storage::kv::snapshot::tests::test_versioned_apis ... ok
test storage::kv::store::tests::changing_max_segment_size ... ok
test storage::kv::store::tests::clone_store ... ok
test storage::kv::store::tests::concurrent_test ... ok
test storage::kv::store::tests::decreasing_max_key_value_size ... ok
test storage::kv::repair::tests::read_across_segments_from_disk ... ok
test storage::kv::store::tests::eventual_durability ... ok
test storage::kv::repair::tests::repair_with_one_record_per_segment ... ok
test storage::kv::store::tests::eventual_durability_records_persist_after_drop ... ok
test storage::kv::store::tests::immediate_durability ... ok
test storage::kv::store::tests::eventual_durability_records_persist_without_wait ... ok
test storage::kv::store::tests::increasing_max_key_value_size ... ok
test storage::kv::store::tests::basic_compaction1 ... ok
test storage::kv::repair::tests::repair_with_corruption_in_first_segment ... ok
test storage::kv::repair::tests::repair_with_corruption_in_middle_segment ... ok
test storage::kv::repair::tests::repair_multiple_segment_with_multiple_records_with_corruption_in_first_segment ... ok
test storage::kv::repair::tests::repair_single_segment_with_multiple_records ... ok
test storage::kv::repair::tests::repair_multiple_segment_with_multiple_records_with_corruption_in_middle_segment ... ok
test storage::kv::repair::tests::repair_with_two_records_per_segment ... ok
test storage::kv::repair::tests::repair_multiple_segment_with_multiple_records_with_corruption_in_last_segment ... ok
test storage::kv::store::tests::store_closed_twice_without_error ... ok
test storage::kv::transaction::tests::basic_scan_single_key ... ok
test storage::kv::store::tests::stop_task_runner ... ok
test storage::kv::store::tests::records_not_lost_when_store_is_closed ... ok
test storage::kv::store::tests::store_open_and_update_options ... ok
test storage::kv::transaction::tests::basic_scan_multiple_keys ... ok
test storage::kv::transaction::tests::empty_scan_should_not_return_an_error ... ok
test storage::kv::transaction::tests::basic_transaction ... ok
test storage::kv::transaction::tests::insert_large_txn_and_get ... ignored
test storage::kv::transaction::tests::g1a ... ok
test storage::kv::transaction::tests::g2_predicate ... ok
test storage::kv::transaction::tests::g0 ... ok
test storage::kv::transaction::tests::is_send_sync ... ok
test storage::kv::store::tests::insert_close_reopen ... ok
test storage::kv::store::tests::strong_durability_records_persist ... ok
test storage::kv::transaction::tests::g1b ... ok
test storage::kv::transaction::tests::g_single ... ok
test storage::kv::transaction::tests::multiple_savepoints_without_ssi ... ok
test storage::kv::transaction::tests::g_single_write_1 ... ok
test storage::kv::transaction::tests::g1c ... ok
test storage::kv::transaction::tests::multiple_savepoints_with_ssi ... ok
test storage::kv::transaction::tests::g2_item ... ok
test storage::kv::transaction::tests::mvcc_serialized_snapshot_isolation ... ok
test storage::kv::transaction::tests::g_single_write_2 ... ok
test storage::kv::transaction::tests::mvcc_serialized_snapshot_isolation_scan ... ok
test storage::kv::transaction::tests::ordered_writes ... ok
test storage::kv::transaction::tests::mvcc_snapshot_isolation ... ok
test storage::kv::transaction::tests::mvcc_snapshot_isolation_scan ... ok
test storage::kv::transaction::tests::savepoint_rollback_on_updated_key ... ok
test storage::kv::transaction::tests::ryow ... ok
test storage::kv::transaction::tests::savepoint_rollback_on_updated_key_with_scan ... ok
test storage::kv::transaction::tests::savepont_with_concurrent_read_txn_with_ssi ... ok
test storage::kv::transaction::tests::savepont_with_concurrent_scan_txn ... ok
test storage::kv::transaction::tests::savepont_with_concurrent_scan_txn_with_new_write ... ok
test storage::kv::transaction::tests::p4 ... ok
test storage::kv::transaction::tests::savepont_with_concurrent_read_txn_without_ssi ... ok
test storage::kv::transaction::tests::scan_multiple_keys_within_single_transaction ... ok
test storage::kv::transaction::tests::pmp_write ... ok
test storage::kv::transaction::tests::pmp ... ok
test storage::log::aol::tests::append ... ok
test storage::kv::transaction::tests::sdb_delete_record_id_bug ... ok
test storage::kv::transaction::tests::test_insert_clear_read_key ... ok
test storage::kv::transaction::tests::transaction_delete_and_scan_test ... ok
test storage::log::aol::tests::append_and_read_two_blocks ... ok
test storage::kv::transaction::tests::transaction_delete_scan ... ok
test storage::log::aol::tests::append_large_record ... ok
test storage::log::aol::tests::append_read_append_read ... ok
test storage::log::aol::tests::fsync_failure ... ok
test storage::log::aol::tests::append_after_reopening_log ... ok
test storage::log::tests::bytes_roundtrip ... ok
test storage::log::aol::tests::read_beyond_current_offset_should_fail ... ok
test storage::log::tests::metadata_extension ... ok
test storage::log::tests::new_empty ... ok
test storage::log::tests::parse_segment_name_invalid_format ... ok
test storage::log::tests::parse_segment_name_with_extension ... ok
test storage::log::tests::parse_segment_name_without_extension ... ok
test storage::log::tests::put_and_get_uint ... ok
test storage::kv::transaction::tests::transaction_delete_from_index ... ok
test storage::log::tests::read_reader_field ... ok
test storage::log::tests::bad_file_header ... ok
test storage::log::tests::check_and_validate_file_header ... ok
test storage::log::aol::tests::random_access_read_performance ... ok
test storage::log::tests::segment_name_with_extension ... ok
test storage::log::tests::segment_name_without_extension ... ok
test storage::log::tests::aol_reopen_empty_file ... ok
test storage::log::aol::tests::sequential_read_performance ... ok
test storage::log::tests::segments_empty_directory ... ok
test storage::log::tests::segments_non_empty_directory ... ok
test storage::log::tests::test_list_segment_ids ... ok
test storage::log::tests::write_reader_field ... ok
test storage::log::tests::segment_corrupted_metadata ... ok
test storage::log::aol::tests::append_records_across_two_files_and_read ... ok
test storage::log::tests::segment_closed_operations ... ok
test storage::log::aol::tests::append_and_reload_to_check_active_segment_id ... ok
test storage::log::tests::aol_append ... ok
test storage::log::tests::segment_reopen_file ... ok
test storage::log::aol::tests::append_across_two_files_and_read ... ok
test storage::log::aol::tests::test_rotate_functionality ... ok
test storage::log::tests::segment_append_read_append ... ok
test storage::log::tests::sync_on_synced_segment ... ok
test storage::log::tests::segment_reopen ... ok
test storage::kv::reader::tests::append_and_read ... ok
test storage::kv::store::tests::store_without_persistance ... ok
test storage::kv::store::tests::bulk_insert_and_reload ... ok
test storage::kv::store::tests::insert_then_read_then_delete_then_read ... ok

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

   Doc-tests surrealkv

running 0 tests

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

@stevefan1999-personal stevefan1999-personal marked this pull request as ready for review September 18, 2024 04:22
@arriqaaq
Copy link
Contributor

arriqaaq commented Oct 2, 2024

Thanks @stevefan1999-personal

As mentioned here, will keep this for a future milestone as it will introduce many breaking changes at the moment.

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.

2 participants