You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sql: release save point did not retry for two version invariant errors
Previously, when release save point was issued for cockroach_restart
this would drive a commit, which could run into retryable errors.
Like the two version invariant error, which is not tagged as a
user facing re triable error, so the client doesn't know to
retry. To address this, this patch converts two version invariant
errors in this case into user facing retryable errors;
Fixes: cockroachdb#107171
Release note (bug fix): Release save point could incorrectly emit
"cannot publish new versions for descriptors" instead of a
retryable error to applications.
fmt.Sprintf(`TransactionRetryWithProtoRefreshError: cannot publish new versions for descriptors: \[\{kv1 %d 1\}\], old versions still in use`, tableDesc.GetID()),
1574
+
) {
1575
+
t.Errorf("err = %v", err)
1576
+
}
1577
+
err=txRetry.Rollback()
1578
+
iferr!=nil {
1579
+
t.Errorf("err = %v", err)
1580
+
}
1581
+
}()
1582
+
1583
+
// Make sure that txRetry does violate the two version lease invariant.
1584
+
testutils.SucceedsSoon(t, func() error {
1585
+
ifatomic.LoadInt64(&violations) ==0 {
1586
+
returnerrors.Errorf("didnt retry schema change")
1587
+
}
1588
+
returnnil
1589
+
})
1590
+
// Commit the first transaction, unblocking txRetry.
1591
+
iferr:=tx.Commit(); err!=nil {
1592
+
t.Fatal(err)
1593
+
}
1594
+
wg.Wait()
1595
+
}
1596
+
1482
1597
// Tests that when a transaction has already returned results
1483
1598
// to the user and the transaction continues on to make a schema change,
1484
1599
// whenever the table lease two version invariant is violated and the
0 commit comments