Skip to content

Commit 5e83da6

Browse files
Update store/mvcc_store.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 01aac5b commit 5e83da6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

store/mvcc_store.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ func (s *mvccStore) ApplyMutations(ctx context.Context, mutations []*KVPairMutat
276276
s.mtx.Lock()
277277
defer s.mtx.Unlock()
278278

279+
for _, mut := range mutations {
280+
if latestVer, ok := s.latestVersionLocked(mut.Key); ok && latestVer.TS > startTS {
281+
return errors.Wrapf(ErrWriteConflict, "key: %s", string(mut.Key))
282+
}
283+
}
284+
279285
commitTS = s.alignCommitTS(commitTS)
280286

281287
for _, mut := range mutations {

0 commit comments

Comments
 (0)