-
Notifications
You must be signed in to change notification settings - Fork 45
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
[RocksDb] Tables consolidation #1466
Conversation
d13598f
to
c61491b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this PR @AhmedSoliman. The changes look good to me. I left a few minor comments. +1 for merging.
// Ensures that both types have the same length, this makes it possible to | ||
// share prefix extractor in rocksdb. | ||
const_assert_eq!( | ||
std::mem::size_of::<PartitionKey>(), | ||
std::mem::size_of::<PartitionId>(), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Idempotency => IDEMPOTENCY_TABLE_NAME, | ||
} | ||
const fn cf_name(_kind: TableKind) -> &'static str { | ||
PARTITION_CF | ||
} | ||
|
||
#[derive(Debug, Copy, Clone, Eq, PartialEq)] | ||
pub enum TableKind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the plan for the TableKind
abstraction? It seems that it does not add a lot of value right now. Maybe it could be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is this one of the follow-ups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's still a useful abstraction, it's now possible to have multiple keys per table, but we might revisit this at some point and clean it up. I'd say that I wouldn't remove it prematurely and only do that when it becomes a hindrance.
This is one step in a series of changes to move to a one CF per partition-id. The change consolidates all partitions into a single CF `data-unpartitioned`. Notes: - This introduces a fixed key prefix to partition CF to improve bloom filter lookups. This change require some subtle handling of scans that spans multiple prefixes, this is handled and is covered by existing test cases. - This adds the ability for a table to have multiple KeyKinds attached. Each TableKey has an associated kind, and the table (TableKind) has a set of KeyKinds associated. - This is designed to allow future separation of tables, or even individual key kinds to separate CFs. - Some values are intentionally passed but not used for (a) clarity at call site and (b) to help with follow-up refactoring. Side note: cluster marker tests fail sporadically, this adds a flush after each temp file write in an attempt to fix them.
[RocksDb] Tables consolidation
This is one step in a series of changes to move to a one CF per partition-id. The change consolidates all partitions into a single CF
data-unpartitioned
.Notes:
Side note: cluster marker tests fail sporadically, this adds a flush after each temp file write in an attempt to fix them.
Stack created with Sapling. Best reviewed with ReviewStack.