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

Only write ref key once when writing with prune_previous_versions #1560

Merged
merged 4 commits into from May 15, 2024

Conversation

poodlewars
Copy link
Collaborator

@poodlewars poodlewars commented May 9, 2024

What does this implement or fix?

We should only write the version ref key once when we write with prune_previous_versions=True. Currently we are writing it twice - once after we write the tombstone all and once when we write the new version. This means that there is a period of time where the symbol is unreadable.

This was fixed a while ago with PR #1104 but regressed with PR #1355.

Any other comments?

Checklist

Checklist for code changes...
  • Have you updated the relevant docstrings, documentation and copyright notice?
  • Is this contribution tested against all ArcticDB's features?
  • Do all exceptions introduced raise appropriate error messages?
  • Are API changes highlighted in the PR description?
  • Is the PR labelled as enhancement or bug so it appears in autogenerated release notes?

@poodlewars poodlewars added the bug Something isn't working label May 9, 2024
@poodlewars poodlewars marked this pull request as ready for review May 9, 2024 15:34
… pytest continues to run indefinitely even after the tests have passed.
@poodlewars
Copy link
Collaborator Author

poodlewars commented May 15, 2024

PR #1355 also added a write_symbol_ref call to write_entry_to_storage. Repeating the exercise above we have:

write_entry_to_storage
|_ compact_and_remove_deleted_indexes (unused, no impact)
  |_ writes the symbol ref a second time
|_ overwrite_symbol_tree
  |_ writes the symbol ref a second time
|_ rewrite_entry
  |_ recover_deleted
    |_ writes the symbol ref a second time
  |_ remove_and_rewrite_version_keys
    |_ writes the symbol ref a second time
  |_ scan_and_rewrite
    |_ writes the symbol ref a second time

overwrite_symbol_tree is used in:

  • initial sync process in replication (no impact really, we don't expect stuff to be readable during the initial sync)
  • fix_symbol_trees (unused)

recover_deleted is only used in tests

remove_and_rewrite_version_keys is unused

scan_and_rewrite is used in fix_ref_key which is unused

…e symbol ref key.

Usage:

write_entry_to_storage
|_ compact_and_remove_deleted_indexes (unused, no impact)
  |_ writes the symbol ref a second time
|_ overwrite_symbol_tree
  |_ writes the symbol ref a second time
|_ rewrite_entry
  |_ recover_deleted
    |_ writes the symbol ref a second time
  |_ remove_and_rewrite_version_keys
    |_ writes the symbol ref a second time
  |_ scan_and_rewrite
    |_ writes the symbol ref a second time

overwrite_symbol_tree is used in:

    initial sync process in replication (no impact really, we don't expect stuff to be readable during the initial sync)
    fix_symbol_trees (unused)

recover_deleted is only used in tests

remove_and_rewrite_version_keys is unused

scan_and_rewrite is used in fix_ref_key which is unused

Testing limited as most call sites are unused. I verified that replication still works correctly after this change.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These changes are just formatting.

@poodlewars poodlewars merged commit 8240ab2 into master May 15, 2024
114 checks passed
@poodlewars poodlewars deleted the tombstone-all-single-ref-key branch May 15, 2024 12:47
poodlewars added a commit that referenced this pull request May 15, 2024
)

#### What does this implement or fix?

We should only write the version ref key once when we write with
`prune_previous_versions=True`. Currently we are writing it twice - once
after we write the tombstone all and once when we write the new version.
This means that there is a period of time where the symbol is
unreadable.

This was fixed a while ago with PR #1104 but regressed with PR #1355.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants