Bug fix: no-op dolt_pull()
was leaving working set dirty
#7882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Customer-reported bug. Two
dolt_pull()
operations on two branches in the same session when local branches are already up to date, with@@autocommit
off, leave the session unable to commit because two branch heads are considered dirty. See new bats test for details on reproducing.The issue is that
DoltSession.SetWorkingSet()
marks that branch head dirty until the transaction is committed. Most merge code paths used by pull involve performing adolt_commit
(), which has the side effect of zeroing out the current transaction, meaning the next statement would get a new transaction and fresh working sets loaded from disk, avoiding the dirty state problem. Only the code path where the branch head is already up to date is affected by this bug. All the merge library code that actually needs to callDoltSession.SetWorkingSet()
(only necessary before adolt_commit
happens, or in the case of a squash where changes should remain in the working set) already does so, making the additional call indolt_pull.go
redundant and leading to this buggy behavior in the no-change case.There are probably still related bugs for session state management during pull and merge operations, but I want to keep this fix narrow to address the customer issue while I build up more robust (non-bats) tests for pull.