Skip to content

Commit 7a19ec0

Browse files
bootjpCopilot
andauthored
Update kv/transaction.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4dd9bbe commit 7a19ec0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

kv/transaction.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,11 @@ func needsTxnCleanup(reqs []*pb.Request) bool {
232232
if req == nil || !req.IsTxn {
233233
continue
234234
}
235-
switch req.Phase {
236-
case pb.Phase_PREPARE, pb.Phase_COMMIT:
235+
// Be conservative: any transactional phase other than NONE/ABORT may have
236+
// left intents that require cleanup, including unknown enum values that
237+
// can appear during rolling upgrades.
238+
if req.Phase != pb.Phase_NONE && req.Phase != pb.Phase_ABORT {
237239
return true
238-
case pb.Phase_NONE, pb.Phase_ABORT:
239-
continue
240240
}
241241
}
242242
return false

0 commit comments

Comments
 (0)