We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95b492b commit f501e4bCopy full SHA for f501e4b
1 file changed
txnkv/transaction/txn.go
@@ -1547,6 +1547,9 @@ func (txn *KVTxn) lockKeysWithSharedLockUpgrade(
1547
assignedPrimaryKey := false
1548
totalKeys := len(normalExclusiveKeys) + len(upgradeKeys)
1549
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.
1553
assignedPrimaryKey = true
1554
keysForPrimary := normalExclusiveKeys
1555
if len(keysForPrimary) == 0 {
0 commit comments