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

[ENH] Add support for delete in blockfile #1957

Closed
wants to merge 1 commit into from

Conversation

HammadB
Copy link
Collaborator

@HammadB HammadB commented Apr 1, 2024

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Add a Into_Result type for casing to Box for results with concrete ChromaErrors as their err type.
    • Add an explicit length check in BlockIterator
  • New functionality
    • Adds support for deletes in blockfiles

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

Copy link
Collaborator Author

HammadB commented Apr 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @HammadB and the rest of your teammates on Graphite Graphite

Copy link

github-actions bot commented Apr 1, 2024

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@HammadB HammadB requested a review from beggers April 1, 2024 22:12
Copy link
Contributor

@beggers beggers left a comment

Choose a reason for hiding this comment

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

🤌

This looks good -- only thing missing is some tests. I'm fine with them being in a follow-up PR.


blockfile.begin_transaction().unwrap();
blockfile.delete(key1.clone()).unwrap();
blockfile.commit_transaction().unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we test rollback here as well?

Copy link
Collaborator Author

@HammadB HammadB Apr 2, 2024

Choose a reason for hiding this comment

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

rollback is unimplemented in this PR. i have a stale stacked PR with proptests


// See if a delta for the target block already exists, if not create a new one and add it to the transaction state
// Creating a delta loads the block entirely into memory
let delta = match transaction_state.get_delta_for_block(&target_block_id) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not familiar with the rollback mechanism here. What happens if we need to rollback the delete?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it discards the whole in-memory state

@HammadB HammadB mentioned this pull request Apr 2, 2024
1 task
@HammadB HammadB closed this May 20, 2024
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