Skip to content

fix(core): delete existing plists when doing a single UID update#9375

Closed
xqqp wants to merge 1 commit into
dgraph-io:mainfrom
xqqp:fix_singleUidUpdate
Closed

fix(core): delete existing plists when doing a single UID update#9375
xqqp wants to merge 1 commit into
dgraph-io:mainfrom
xqqp:fix_singleUidUpdate

Conversation

@xqqp
Copy link
Copy Markdown
Contributor

@xqqp xqqp commented Apr 14, 2025

If a single UID predicate (not a list) is updated, the old value is not deleted. This bug was introduced in #9292.

This PR adds the old behavior back.

Related: https://discuss.hypermode.com/t/inconsistent-query-result/19844/7

Note: I don't know why this was changed in the original PR as the existing comment in the code says that the loop is necessary, so please review carefully.

@xqqp xqqp requested a review from a team April 14, 2025 10:19
@xqqp xqqp force-pushed the fix_singleUidUpdate branch from 660e5a9 to d88bef5 Compare April 14, 2025 10:21
@xqqp xqqp changed the title fix: delete existing plists when doing a single UID update fix(core): delete existing plists when doing a single UID update Apr 14, 2025
@ghost
Copy link
Copy Markdown

ghost commented Apr 15, 2025

Hey, thanks a lot for your diff. You saved me precious time trying to track down which change caused the issue. The reason I removed it in first place was that I thought iterate() would fix it. But I guess there were some corner cases. A simple fix was you could just iterate on m.startTs - 1. I checked, it's also passing all the tests. However we are going a different direction. I don't to keep thinking about the corner cases, we are just simply going to use deleteAll to delete all the old values fixing the issue.

@ghost ghost closed this Apr 15, 2025
@xqqp xqqp deleted the fix_singleUidUpdate branch April 16, 2025 13:58
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant