Skip to content
New issue

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

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

Already on GitHub? # to your account

Introduce the block version ref key #1969

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

poodlewars
Copy link
Collaborator

@poodlewars poodlewars commented Oct 31, 2024

Useful for background jobs.

See design doc shared internally - https://manwiki.maninvestments.com/x/n4CsFg .

test_snapshot.cpp has rotted and wasn't included in any cmake targets (so hasn't compiled for months or ever). Since it didn't check anything very useful, I've just removed it here.

An alternative design would be to store the segment sorted by stream ID, like we do for snapshots, and work with it directly rather than transforming it in to an unordered_map. This would save us the cost of transforming the segment to the unordered_map and back again. I plan to see how the current implementation performs in replication and we can swap out to the other idea at any time until we release this (the point of no return is once unordered block ref keys are serialized in production).


BlockKey(KeyType key_type, StreamId id, std::unordered_map<StreamId, AtomKey> keys);

BlockKey block_with_same_keys(StreamId new_id);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block_with_same_id?

bool valid_{true};
KeyType block_key_type_;
StreamId id_;
KeyType expected_key_type_of_contents_;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably expected_key_type_ is fine


namespace arcticdb::version_store {

BlockKey::BlockKey(KeyType key_type, StreamId id, SegmentInMemory &&segment) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally sold on the name, I don't think it really reflects what the class does. Even KeyBlock might be better as it expresses what it is - i.e. a block of keys.

@poodlewars poodlewars marked this pull request as ready for review November 13, 2024 17:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants