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

Robj/indirection support #491

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

Robj/indirection support #491

wants to merge 64 commits into from

Conversation

rtjohnso
Copy link
Contributor

No description provided.

- modify trunk_split_leaf to never split more than possible
- tweak default test parameters
- modify functionality test to use pareto-distributed message lengths
@netlify
Copy link

netlify bot commented Nov 29, 2022

Deploy Preview for splinterdb canceled.

Name Link
🔨 Latest commit 9db4655
🔍 Latest deploy log https://app.netlify.com/sites/splinterdb/deploys/6447980f1f7a760008f1207e

@rtjohnso
Copy link
Contributor Author

rtjohnso commented Nov 30, 2022

Reviewing guide

This is a big PR, but it can be logically broken down into a few layers. Feel free to do reviews for each layer separately.

Recommended order to review files:

The mini_allocator layer:

  1. mini_allocator.[hc]. The main thing is to add support for sub-page allocations, multi-page allocations, and extent sharing. It also adds support for having a different page type for each batch. It incidentally eliminates pinning support, since the pinning flag didn't actually do anything. Also reorg the mini_allocator struct to cleanly separate constant state (e.g. num_batches) from dynamic state (e.g. num_extents).
  2. Optionally: check out routing_filter.c, where the only changes are to match the new mini_allocator APIs.
  3. trunk.[hc] are also only minor changes, except that it also forces splits to never split more than the parent can handle.

The blob code:

  1. blob.[hc]. Code for accessing blobs.
  2. blob_build.[hc]. Code for building and cloning blobs. Blob building code is broken out into a separate file to avoid a circular dependency blob_build -> mini_allocator -> data_internal -> blob. If blob and blob_build were all in a single source file, this would be a cycle.
  3. Detour to blob_test.c.

The data adapter layer:

  1. data_internal.[hc] and data_blob_build.[hc]. Deblobify things before passing them to user-provided functions. Also various utilities for (de-)blobifying messages, merge_accumulators, etc. data_blob_build is broken out for the same circular dependency reason.

Uses of the data adapter layer to add blob support in the rest of the code:

  1. shard_log.[hc]. Handles blobs. Also, has a function to build a blob in the log's mini_allocator. The intention here is that, when the user inserts a large value, the trunk will blobify it in the log's mini_allocator, and then insert the blob into the btree, and then insert a log record with the blob and the generation number from the btree.
  2. btree.[hc]. Handles big values in insert and pack.
  3. splinterdb.c. De-blobify things before returning them to the user.

The rest:

  1. Miscellaneous other files and tests.

rtjohnso and others added 16 commits November 30, 2022 02:16
Fixes a bug where memtable_maybe_rotate_and_get_insert_lock would
speculatively increment the memtable generation even when the next
memtable was not yet ready. This would cause concurrent lookup threads
to attempt to access that memtable, resulting in errors.

This fix requires the insert threads to wait until the next memtable is
ready before finalizing the current one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants