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

fix(core): fix duplicate mutation entries for count index #9208

Merged
merged 6 commits into from
Nov 1, 2024

Conversation

harshil-goel
Copy link
Contributor

@harshil-goel harshil-goel commented Oct 30, 2024

For calculating length, we want to be able to just look at the mutable layer and not check immutable layer to improve time. For this we had an assumption that we won't have duplicate mutations stored. Turns out, the assumption is only try for index keys, not for the data keys. This PR fixes it for count keys also.
Since duplicate keys can be present in the database right now for people using it from before, we advise to rebuild count index after this upgrade.

@harshil-goel harshil-goel requested a review from a team as a code owner October 30, 2024 07:21
@github-actions github-actions bot added area/testing Testing related issues area/core internal mechanisms go Pull requests that update Go code labels Oct 30, 2024
@harshil-goel harshil-goel merged commit 237dd74 into main Nov 1, 2024
13 of 14 checks passed
@harshil-goel harshil-goel deleted the harshil-goel/fix-txn-old branch November 1, 2024 17:36
harshil-goel added a commit that referenced this pull request Nov 5, 2024
Due to duplicate entries in the count index, sometimes we had wrong
count being reported. This wrong count was causing the transcation is
too old issue. This diff fixes the duplicate entries fixing the issue.
harshil-goel added a commit that referenced this pull request Nov 5, 2024
)

Due to duplicate entries in the count index, sometimes we had wrong
count being reported. This wrong count was causing the transcation is
too old issue. This diff fixes the duplicate entries fixing the issue.
mangalaman93 pushed a commit that referenced this pull request Dec 6, 2024
Currently the delta postings are stored in a map. When we use the cache,
these deltas gets unnecessarily copied again and again because of the
limitations of the map. We have introduced a new struct for holding the
mutable layer, that would allow us to work on the list of deltas. 

With the introduction of this, we can now pass around posting lists from
one transaction to another without copying the map.

We also store results such as delete markers, uid to posting map, length
to improve query performance.

This PR also fixes bugs in the count index introduced in the PR #9208.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core internal mechanisms area/testing Testing related issues go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

1 participant