Skip to content

Commit f501e4b

Browse files
committed
chore: add comment
1 parent 95b492b commit f501e4b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

txnkv/transaction/txn.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,9 @@ func (txn *KVTxn) lockKeysWithSharedLockUpgrade(
15471547
assignedPrimaryKey := false
15481548
totalKeys := len(normalExclusiveKeys) + len(upgradeKeys)
15491549
if txn.committer.primaryKey == nil {
1550+
// Prefer selecting the primary from freshly requested exclusive locks
1551+
// when possible, so the primary is not just a shared-locked key that
1552+
// still depends on upgrade success.
15501553
assignedPrimaryKey = true
15511554
keysForPrimary := normalExclusiveKeys
15521555
if len(keysForPrimary) == 0 {

0 commit comments

Comments
 (0)