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

Support the ignore missing key read option in recurse_index_keys #1844

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

poodlewars
Copy link
Collaborator

@poodlewars poodlewars commented Sep 20, 2024

This is required for delayed deletes to work correctly - https://github.com/man-group/arcticdb-enterprise/pull/167 includes an end to end failing test to motivate this.

The issue is that if we have a snapshot being modified over time, replication might sync over its current state from the source storage before the index keys inside it. So delayed deletes needs to be tolerant to the fact that some of the keys it is asked to recurse may not actually exist.

I also noticed that recurse_index_keys requires all the index keys it is run over to be for the same symbol. I'm going to check that we are in fact doing that, and add some debug checks, as a follow up.

This is required for delayed deletes to work correctly.
for (auto &&key : sub_keys) {
res.emplace(std::move(key));
}
} else if (index_key.type() == KeyType::TABLE_INDEX) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I considered pulling out the different behaviours based on type to functions as this is getting quite messy, but the increased indirection made things harder to follow rather than easier.

if (opts.ignores_missing_key_) {
log::version().info("Missing key while recursing index key {}", e.keys());
} else {
throw storage::KeyNotFoundException(std::move(e.keys()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit

Suggested change
throw storage::KeyNotFoundException(std::move(e.keys()));
throw;

will rethrow the current excepion

@poodlewars poodlewars merged commit e7ca73f into master Oct 1, 2024
116 checks passed
@poodlewars poodlewars deleted the support-ignore-missing-key-option branch October 1, 2024 07:52
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.

3 participants