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

#384 Initial Changes for confirmation #393

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ssonthal
Copy link
Contributor

Resolves #384

List of Changes -

  1. A new property in IBatchContext called as NullPage set to new Page((*ptr)0).
  2. All DeleteByPrefix methods checking if prefix is empty, then registering the page for future reuse and returning batch.NullPage.

Pending Changes -
Recursively calling for child pages (if the prefix is empty) - need help here.

@ssonthal ssonthal marked this pull request as draft September 18, 2024 16:24
@ssonthal
Copy link
Contributor Author

Hey @Scooletz do these changes look good?

Copy link
Contributor

@Scooletz Scooletz left a comment

Choose a reason for hiding this comment

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

Looks really promising 🙂
Some test could be added to ensure that the tree is properly rolled up and the pages are reused. Like: writing a big tree in one block, removing in other, spinning one block to make them reusable and reuse again.

Scheduled a run for GH workflow and added some remarks that should improve the logic.

src/Paprika/Store/IBatchContext.cs Outdated Show resolved Hide resolved
@ssonthal ssonthal marked this pull request as ready for review September 24, 2024 12:01
@ssonthal
Copy link
Contributor Author

Hi @Scooletz , i made the suggested fix in the NullPage declaration. Will work on the test cases like you suggested.

@ssonthal ssonthal marked this pull request as draft September 24, 2024 12:14
@ssonthal
Copy link
Contributor Author

ssonthal commented Oct 5, 2024

Hey @Scooletz , I couldn't pick it up earlier due to other work. Resuming it now. Can you kindly help me with existing code references to write these test cases?

I looked over the PagedDbTests.cs and existing DeleteByPrefix test methods. But I think what you described requires a different approach.

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.

Page management when deleting by prefix
2 participants