From b34520677751951427adc1aadaa0f16cb182c0e3 Mon Sep 17 00:00:00 2001 From: j82w Date: Thu, 6 Apr 2023 10:39:07 -0400 Subject: [PATCH 1/2] statusccl: fix flaky TestTenantStatusAPI txn_id_resolution The txn resolution add a txn id to the cache, and then in a separate call updates the txn id with the fingerprint. The test previously assumed if there was a record it would always have a valid fingerprint, but that is not true. The test is modified to add retry logic to wait for the fingerprint to be updated. The retry time was set to always be 1 minute, because SucceedsSoon only waits 5 seconds for race scenario which is not enough time for the resolution to complete. Epic: none part of: #99770 Release note: none --- pkg/ccl/serverccl/statusccl/tenant_status_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/ccl/serverccl/statusccl/tenant_status_test.go b/pkg/ccl/serverccl/statusccl/tenant_status_test.go index 61a7b7b956d6..1492cb73ec58 100644 --- a/pkg/ccl/serverccl/statusccl/tenant_status_test.go +++ b/pkg/ccl/serverccl/statusccl/tenant_status_test.go @@ -1207,7 +1207,7 @@ func testTxnIDResolutionRPC(ctx context.Context, t *testing.T, helper serverccl. "expected a valid txnID, but %+v is found", result) sqlConn.Exec(t, "COMMIT") - testutils.SucceedsSoon(t, func() error { + testutils.SucceedsWithin(t, func() error { resp, err := status.TxnIDResolution(ctx, &serverpb.TxnIDResolutionRequest{ CoordinatorID: strconv.Itoa(int(coordinatorNodeID)), TxnIDs: []uuid.UUID{txnID}, @@ -1220,9 +1220,15 @@ func testTxnIDResolutionRPC(ctx context.Context, t *testing.T, helper serverccl. require.Equal(t, txnID, resp.ResolvedTxnIDs[0].TxnID, "expected to find txn %s on coordinator node %d, but it "+ "was not", txnID.String(), coordinatorNodeID) - require.NotEqual(t, appstatspb.InvalidTransactionFingerprintID, resp.ResolvedTxnIDs[0].TxnFingerprintID) + + // It's possible that adding the transaction id to the cache and + // updating the transaction id with a valid fingerprint are done in + // 2 separate batches. This allows retries to wait for a valid fingerprint + if appstatspb.InvalidTransactionFingerprintID == resp.ResolvedTxnIDs[0].TxnFingerprintID { + return fmt.Errorf("transaction fingerprint id not updated yet. TxnFingerprintID: %d", resp.ResolvedTxnIDs[0].TxnFingerprintID) + } return nil - }) + }, 1*time.Minute) } t.Run("regular_cluster", func(t *testing.T) { From 5d1f4bbeb167484d5ae7f3257c15880fb6f4cbc2 Mon Sep 17 00:00:00 2001 From: e-mbrown Date: Fri, 7 Apr 2023 14:43:04 -0400 Subject: [PATCH 2/2] licenses: Update BSL change date for master/23/2 This commit updates the BSL license for master/23.2. Release note: None --- licenses/BSL.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/licenses/BSL.txt b/licenses/BSL.txt index c47debedb41c..62ce3187227d 100644 --- a/licenses/BSL.txt +++ b/licenses/BSL.txt @@ -3,7 +3,7 @@ Business Source License 1.1 Parameters Licensor: Cockroach Labs, Inc. -Licensed Work: CockroachDB 23.1 +Licensed Work: CockroachDB 23.2 The Licensed Work is (c) 2023 Cockroach Labs, Inc. Additional Use Grant: You may make use of the Licensed Work, provided that you may not use the Licensed Work for a Database @@ -15,7 +15,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that Licensed Work by creating tables whose schemas are controlled by such third parties. -Change Date: 2026-04-01 +Change Date: 2026-10-01 Change License: Apache License, Version 2.0