diff --git a/pkg/ccl/backupccl/tenant_backup_nemesis_test.go b/pkg/ccl/backupccl/tenant_backup_nemesis_test.go index 47fdd0ba9362..75e2c38c1f20 100644 --- a/pkg/ccl/backupccl/tenant_backup_nemesis_test.go +++ b/pkg/ccl/backupccl/tenant_backup_nemesis_test.go @@ -597,7 +597,7 @@ func (r *randomBackupNemesis) runNemesis(ctx context.Context) error { } func (r *randomBackupNemesis) makeRandomBankTable(prefix string) (string, error) { - tableName := fmt.Sprintf("%s_%s", prefix, uuid.FastMakeV4().String()) + tableName := fmt.Sprintf("%s_%s", prefix, uuid.MakeV4().String()) if _, err := r.tenantDB.Exec(fmt.Sprintf(`CREATE TABLE "%s" (id INT PRIMARY KEY, n INT, s STRING)`, tableName)); err != nil { return "", err } diff --git a/pkg/cli/debug_recover_loss_of_quorum_test.go b/pkg/cli/debug_recover_loss_of_quorum_test.go index 67e6e3d41e64..4d6da545af4e 100644 --- a/pkg/cli/debug_recover_loss_of_quorum_test.go +++ b/pkg/cli/debug_recover_loss_of_quorum_test.go @@ -380,7 +380,7 @@ func TestStageVersionCheck(t *testing.T) { // To avoid crafting real replicas we use StaleLeaseholderNodeIDs to force // node to stage plan for verification. p := loqrecoverypb.ReplicaUpdatePlan{ - PlanID: uuid.FastMakeV4(), + PlanID: uuid.MakeV4(), Version: v, ClusterID: tc.Server(0).StorageClusterID().String(), DecommissionedNodeIDs: []roachpb.NodeID{4}, diff --git a/pkg/cmd/roachtest/tests/mvcc_gc.go b/pkg/cmd/roachtest/tests/mvcc_gc.go index 322db4496ac8..545236882ab8 100644 --- a/pkg/cmd/roachtest/tests/mvcc_gc.go +++ b/pkg/cmd/roachtest/tests/mvcc_gc.go @@ -628,7 +628,7 @@ func sendBatchRequest( if err != nil { return kvpb.BatchResponse{}, err } - requestFileName := "request-" + uuid.FastMakeV4().String() + ".json" + requestFileName := "request-" + uuid.MakeV4().String() + ".json" if err := c.PutString(ctx, reqArg, requestFileName, 0755, c.Node(node)); err != nil { return kvpb.BatchResponse{}, err } diff --git a/pkg/jobs/jobsprofiler/profiler_test.go b/pkg/jobs/jobsprofiler/profiler_test.go index 161b9f30021f..413a485ccbc4 100644 --- a/pkg/jobs/jobsprofiler/profiler_test.go +++ b/pkg/jobs/jobsprofiler/profiler_test.go @@ -125,7 +125,7 @@ func TestStorePerNodeProcessorProgressFraction(t *testing.T) { ctx := context.Background() defer s.Stopper().Stop(ctx) - randID := uuid.FastMakeV4() + randID := uuid.MakeV4() componentID := execinfrapb.ComponentID{ FlowID: execinfrapb.FlowID{UUID: randID}, Type: execinfrapb.ComponentID_PROCESSOR, diff --git a/pkg/kv/kvserver/batcheval/declare_test.go b/pkg/kv/kvserver/batcheval/declare_test.go index 5744e0862168..0a07148c88e8 100644 --- a/pkg/kv/kvserver/batcheval/declare_test.go +++ b/pkg/kv/kvserver/batcheval/declare_test.go @@ -65,7 +65,7 @@ func TestRequestsSerializeWithAllKeys(t *testing.T) { } testTxn := &roachpb.Transaction{ TxnMeta: enginepb.TxnMeta{ - ID: uuid.FastMakeV4(), + ID: uuid.MakeV4(), Key: startKey, WriteTimestamp: hlc.Timestamp{WallTime: 1}, }, diff --git a/pkg/kv/kvserver/gc/gc_test.go b/pkg/kv/kvserver/gc/gc_test.go index 34dc4ea17d05..3dd9a3550611 100644 --- a/pkg/kv/kvserver/gc/gc_test.go +++ b/pkg/kv/kvserver/gc/gc_test.go @@ -338,7 +338,7 @@ type testIntent struct { func generateScattered(total int, txns int, maxKeySize int, random *rand.Rand) []testIntent { var txnIds []uuid.UUID for len(txnIds) < txns { - txnIds = append(txnIds, uuid.FastMakeV4()) + txnIds = append(txnIds, uuid.MakeV4()) } var intents []testIntent for len(intents) < total { @@ -367,7 +367,7 @@ func generateSequential(total int, maxTxnSize int, maxKeySize int, random *rand. for ; len(intents) < total; leftForTransaction-- { if leftForTransaction == 0 { leftForTransaction = intnFrom1(random, maxTxnSize) - txnUUID = uuid.FastMakeV4() + txnUUID = uuid.MakeV4() } intents = append(intents, testIntent{ @@ -425,7 +425,7 @@ func TestGCIntentBatcherErrorHandling(t *testing.T) { key1 := []byte("key1") key2 := []byte("key2") - txn1 := enginepb.MVCCMetadata{Txn: &enginepb.TxnMeta{ID: uuid.FastMakeV4()}} + txn1 := enginepb.MVCCMetadata{Txn: &enginepb.TxnMeta{ID: uuid.MakeV4()}} // Verify intent cleanup error is propagated to caller. info := Info{} diff --git a/pkg/kv/kvserver/kvstorage/datadriven_test.go b/pkg/kv/kvserver/kvstorage/datadriven_test.go index c5991bbe3b79..2ac67343fac6 100644 --- a/pkg/kv/kvserver/kvstorage/datadriven_test.go +++ b/pkg/kv/kvserver/kvstorage/datadriven_test.go @@ -45,7 +45,7 @@ func newEnv(t *testing.T) *env { // all of it with the datadriven harness! require.NoError(t, WriteClusterVersion(ctx, eng, clusterversion.TestingClusterVersion)) require.NoError(t, InitEngine(ctx, eng, roachpb.StoreIdent{ - ClusterID: uuid.FastMakeV4(), + ClusterID: uuid.MakeV4(), NodeID: 1, StoreID: 1, })) diff --git a/pkg/kv/kvserver/loqrecovery/loqrecoverypb/recovery_test.go b/pkg/kv/kvserver/loqrecovery/loqrecoverypb/recovery_test.go index caab3609a034..fc0dc4c2c6d5 100644 --- a/pkg/kv/kvserver/loqrecovery/loqrecoverypb/recovery_test.go +++ b/pkg/kv/kvserver/loqrecovery/loqrecoverypb/recovery_test.go @@ -97,7 +97,7 @@ func TestClusterInfoMergeChecksDescriptor(t *testing.T) { } func TestClusterInfoMergeSameClusterID(t *testing.T) { - uuid1 := uuid.FastMakeV4() + uuid1 := uuid.MakeV4() info1 := ClusterReplicaInfo{ ClusterID: uuid1.String(), Descriptors: []roachpb.RangeDescriptor{{RangeID: 1}}, @@ -125,8 +125,8 @@ func TestClusterInfoMergeSameClusterID(t *testing.T) { } func TestClusterInfoMergeRejectDifferentMetadata(t *testing.T) { - uuid1 := uuid.FastMakeV4() - uuid2 := uuid.FastMakeV4() + uuid1 := uuid.MakeV4() + uuid2 := uuid.MakeV4() info1 := ClusterReplicaInfo{ ClusterID: uuid1.String(), Descriptors: []roachpb.RangeDescriptor{{RangeID: 1}}, @@ -167,7 +167,7 @@ func TestClusterInfoMergeRejectDifferentMetadata(t *testing.T) { } func TestClusterInfoInitializeByMerge(t *testing.T) { - uuid1 := uuid.FastMakeV4().String() + uuid1 := uuid.MakeV4().String() version1 := roachpb.Version{Major: 22, Minor: 2} info := ClusterReplicaInfo{ ClusterID: uuid1, diff --git a/pkg/kv/kvserver/loqrecovery/plan_test.go b/pkg/kv/kvserver/loqrecovery/plan_test.go index 3641fcc63548..9dbfd61fb0c2 100644 --- a/pkg/kv/kvserver/loqrecovery/plan_test.go +++ b/pkg/kv/kvserver/loqrecovery/plan_test.go @@ -39,7 +39,7 @@ func TestVersionIsPreserved(t *testing.T) { // infoWithVersion creates a skeleton info that passes all checks beside version. func infoWithVersion(v roachpb.Version) loqrecoverypb.ClusterReplicaInfo { return loqrecoverypb.ClusterReplicaInfo{ - ClusterID: uuid.FastMakeV4().String(), + ClusterID: uuid.MakeV4().String(), Version: v, } } diff --git a/pkg/kv/kvserver/loqrecovery/store_test.go b/pkg/kv/kvserver/loqrecovery/store_test.go index fa99c6921c4b..64bb67818d9b 100644 --- a/pkg/kv/kvserver/loqrecovery/store_test.go +++ b/pkg/kv/kvserver/loqrecovery/store_test.go @@ -23,7 +23,7 @@ import ( ) func createSomePlan(rangeID int) loqrecoverypb.ReplicaUpdatePlan { - planID := uuid.FastMakeV4() + planID := uuid.MakeV4() return loqrecoverypb.ReplicaUpdatePlan{ PlanID: planID, Updates: []loqrecoverypb.ReplicaUpdate{ diff --git a/pkg/kv/kvserver/replica_consistency_test.go b/pkg/kv/kvserver/replica_consistency_test.go index a1f5377f802c..c31e82abc198 100644 --- a/pkg/kv/kvserver/replica_consistency_test.go +++ b/pkg/kv/kvserver/replica_consistency_test.go @@ -51,7 +51,7 @@ func TestReplicaChecksumVersion(t *testing.T) { testutils.RunTrueAndFalse(t, "matchingVersion", func(t *testing.T, matchingVersion bool) { cc := kvserverpb.ComputeChecksum{ - ChecksumID: uuid.FastMakeV4(), + ChecksumID: uuid.MakeV4(), Mode: kvpb.ChecksumMode_CHECK_FULL, } if matchingVersion { @@ -190,7 +190,7 @@ func TestGetChecksumNotSuccessfulExitConditions(t *testing.T) { } // Checksum computation failed to start. - id := uuid.FastMakeV4() + id := uuid.MakeV4() c, _ := tc.repl.trackReplicaChecksum(id) close(c.started) rc, err := tc.repl.getChecksum(ctx, id) @@ -198,7 +198,7 @@ func TestGetChecksumNotSuccessfulExitConditions(t *testing.T) { require.Nil(t, rc.Checksum) // Checksum computation started, but failed. - id = uuid.FastMakeV4() + id = uuid.MakeV4() c, _ = tc.repl.trackReplicaChecksum(id) var g errgroup.Group g.Go(func() error { @@ -213,13 +213,13 @@ func TestGetChecksumNotSuccessfulExitConditions(t *testing.T) { require.NoError(t, g.Wait()) // The initial wait for the task start expires. This will take 10ms. - id = uuid.FastMakeV4() + id = uuid.MakeV4() rc, err = tc.repl.getChecksum(ctx, id) require.ErrorContains(t, err, "checksum computation did not start") require.Nil(t, rc.Checksum) // The computation has started, but the request context timed out. - id = uuid.FastMakeV4() + id = uuid.MakeV4() c, _ = tc.repl.trackReplicaChecksum(id) g.Go(func() error { c.started <- func() {} @@ -232,7 +232,7 @@ func TestGetChecksumNotSuccessfulExitConditions(t *testing.T) { require.NoError(t, g.Wait()) // Context is canceled during the initial waiting. - id = uuid.FastMakeV4() + id = uuid.MakeV4() ctx, cancel = context.WithCancel(context.Background()) cancel() rc, err = tc.repl.getChecksum(ctx, id) @@ -241,7 +241,7 @@ func TestGetChecksumNotSuccessfulExitConditions(t *testing.T) { // The task failed to start because the checksum collection request did not // join. Later, when it joins, it doesn't find any trace and times out. - id = uuid.FastMakeV4() + id = uuid.MakeV4() c, _ = tc.repl.trackReplicaChecksum(id) require.NoError(t, startChecksumTask(context.Background(), id)) // TODO(pavelkalinnikov): Avoid this long wait in the test. diff --git a/pkg/roachpb/data.go b/pkg/roachpb/data.go index e0742a0f7230..97d414b077b1 100644 --- a/pkg/roachpb/data.go +++ b/pkg/roachpb/data.go @@ -988,7 +988,7 @@ func MakeTransaction( admissionPriority admissionpb.WorkPriority, omitInRangefeeds bool, ) Transaction { - u := uuid.FastMakeV4() + u := uuid.MakeV4() gul := now.Add(maxOffsetNs, 0) return Transaction{ diff --git a/pkg/rpc/down_node_test.go b/pkg/rpc/down_node_test.go index 2f2a51a16ec2..4e2711ef7c36 100644 --- a/pkg/rpc/down_node_test.go +++ b/pkg/rpc/down_node_test.go @@ -42,7 +42,7 @@ func TestConnectingToDownNode(t *testing.T) { testutils.RunTrueAndFalse(t, "refused", func(t *testing.T, refused bool) { ctx := context.Background() - rpcCtx := newTestContext(uuid.FastMakeV4(), &timeutil.DefaultTimeSource{}, time.Second, stop.NewStopper()) + rpcCtx := newTestContext(uuid.MakeV4(), &timeutil.DefaultTimeSource{}, time.Second, stop.NewStopper()) defer rpcCtx.Stopper.Stop(ctx) rpcCtx.NodeID.Set(context.Background(), 1) diff --git a/pkg/server/distsql_flows_test.go b/pkg/server/distsql_flows_test.go index 035aaf47b889..b0548a66e88e 100644 --- a/pkg/server/distsql_flows_test.go +++ b/pkg/server/distsql_flows_test.go @@ -31,7 +31,7 @@ func TestMergeDistSQLRemoteFlows(t *testing.T) { flowIDs := make([]execinfrapb.FlowID, 4) for i := range flowIDs { - flowIDs[i].UUID = uuid.FastMakeV4() + flowIDs[i].UUID = uuid.MakeV4() } sort.Slice(flowIDs, func(i, j int) bool { return bytes.Compare(flowIDs[i].GetBytes(), flowIDs[j].GetBytes()) < 0 diff --git a/pkg/sql/catalog/schematelemetry/schema_telemetry_job.go b/pkg/sql/catalog/schematelemetry/schema_telemetry_job.go index 54a50c8b11e7..dedbf1ce6d99 100644 --- a/pkg/sql/catalog/schematelemetry/schema_telemetry_job.go +++ b/pkg/sql/catalog/schematelemetry/schema_telemetry_job.go @@ -88,7 +88,7 @@ func (t schemaTelemetryResumer) Resume(ctx context.Context, execCtx interface{}) return err } - events, err := CollectClusterSchemaForTelemetry(ctx, p.ExecCfg(), asOf, uuid.FastMakeV4(), maxRecords) + events, err := CollectClusterSchemaForTelemetry(ctx, p.ExecCfg(), asOf, uuid.MakeV4(), maxRecords) if err != nil || len(events) == 0 { return err } diff --git a/pkg/sql/catalog/systemschema_test/systemschema_test.go b/pkg/sql/catalog/systemschema_test/systemschema_test.go index 0b73af19dd2d..37067f071ad7 100644 --- a/pkg/sql/catalog/systemschema_test/systemschema_test.go +++ b/pkg/sql/catalog/systemschema_test/systemschema_test.go @@ -85,7 +85,7 @@ func runTest(t *testing.T, path string, db *gosql.DB, execCfg *sql.ExecutorConfi return sb.String() case "schema_telemetry": - snapshotID := uuid.FastMakeV4() + snapshotID := uuid.MakeV4() maxRecords := 100000 // By default, collect the entirety of the system schema. // In that case, the snapshot ID won't matter. diff --git a/pkg/sql/colcontainer/diskqueue.go b/pkg/sql/colcontainer/diskqueue.go index 35491fcbc628..f76a4430a184 100644 --- a/pkg/sql/colcontainer/diskqueue.go +++ b/pkg/sql/colcontainer/diskqueue.go @@ -400,7 +400,7 @@ func newDiskQueue( return nil, err } d := &diskQueue{ - dirName: uuid.FastMakeV4().String(), + dirName: uuid.MakeV4().String(), typs: typs, cfg: cfg, files: make([]file, 0, 4), diff --git a/pkg/sql/contention/contentionutils/concurrent_buffer_guard_test.go b/pkg/sql/contention/contentionutils/concurrent_buffer_guard_test.go index 0f41aa0355c5..b2cd3d40bdbe 100644 --- a/pkg/sql/contention/contentionutils/concurrent_buffer_guard_test.go +++ b/pkg/sql/contention/contentionutils/concurrent_buffer_guard_test.go @@ -186,7 +186,7 @@ func randomGeneratedInput() (input []pair, expected map[uuid.UUID]int) { p := pair{} for i := 0; i < inputSize; i++ { - p.k = uuid.FastMakeV4() + p.k = uuid.MakeV4() p.v = rand.Int() input = append(input, p) expected[p.k] = p.v diff --git a/pkg/sql/contention/event_store_test.go b/pkg/sql/contention/event_store_test.go index 47caee63e804..eb6309227c46 100644 --- a/pkg/sql/contention/event_store_test.go +++ b/pkg/sql/contention/event_store_test.go @@ -148,7 +148,7 @@ func TestCollectionThreshold(t *testing.T) { { BlockingEvent: kvpb.ContentionEvent{ TxnMeta: enginepb.TxnMeta{ - ID: uuid.FastMakeV4(), + ID: uuid.MakeV4(), }, Duration: 10 * time.Millisecond, }, @@ -156,7 +156,7 @@ func TestCollectionThreshold(t *testing.T) { { BlockingEvent: kvpb.ContentionEvent{ TxnMeta: enginepb.TxnMeta{ - ID: uuid.FastMakeV4(), + ID: uuid.MakeV4(), }, Duration: 2 * time.Second, }, @@ -206,7 +206,7 @@ func BenchmarkEventStoreIntake(b *testing.B) { input := make([]contentionpb.ExtendedContentionEvent, 0, b.N) for i := 0; i < b.N; i++ { event := contentionpb.ExtendedContentionEvent{} - event.BlockingEvent.TxnMeta.ID = uuid.FastMakeV4() + event.BlockingEvent.TxnMeta.ID = uuid.MakeV4() input = append(input, event) } starter := make(chan struct{}) @@ -271,11 +271,11 @@ func randomlyGenerateTestData(testSize int, numOfCoordinator int) []testData { for i := 0; i < testSize; i++ { tcs = append(tcs, testData{ blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: appstatspb.TransactionFingerprintID(math.MaxUint64 - uint64(i)), }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: appstatspb.TransactionFingerprintID(math.MaxUint64/2 - uint64(i)), }, coordinatorNodeID: strconv.Itoa(rand.Intn(numOfCoordinator)), diff --git a/pkg/sql/contention/resolver_test.go b/pkg/sql/contention/resolver_test.go index c246677494e1..bbf52ae144cb 100644 --- a/pkg/sql/contention/resolver_test.go +++ b/pkg/sql/contention/resolver_test.go @@ -41,66 +41,66 @@ func TestResolver(t *testing.T) { tcs := []testData{ { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 100, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 900, }, coordinatorNodeID: "1", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 101, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 901, }, coordinatorNodeID: "1", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 102, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 903, }, coordinatorNodeID: "1", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 200, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 904, }, coordinatorNodeID: "2", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 201, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 905, }, coordinatorNodeID: "2", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 300, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 906, }, coordinatorNodeID: "3", @@ -130,55 +130,55 @@ func TestResolver(t *testing.T) { tcs := []testData{ { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 101, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 901, }, coordinatorNodeID: "3", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: appstatspb.InvalidTransactionFingerprintID, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 902, }, coordinatorNodeID: "1", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 102, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 903, }, coordinatorNodeID: "1", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 201, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: appstatspb.InvalidTransactionFingerprintID, }, coordinatorNodeID: "2", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: appstatspb.InvalidTransactionFingerprintID, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: appstatspb.InvalidTransactionFingerprintID, }, coordinatorNodeID: "2", @@ -213,11 +213,11 @@ func TestResolver(t *testing.T) { newData := []testData{ { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 2000, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 904, }, coordinatorNodeID: "2", @@ -311,26 +311,26 @@ func TestResolver(t *testing.T) { t.Run("retry_after_missing_value", func(t *testing.T) { statusServer.clear() - missingTxnID := uuid.FastMakeV4() + missingTxnID := uuid.MakeV4() tcs := []testData{ { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 101, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 901, }, coordinatorNodeID: "3", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 102, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 902, }, coordinatorNodeID: "1", @@ -341,7 +341,7 @@ func TestResolver(t *testing.T) { TxnFingerprintID: 1000, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 903, }, coordinatorNodeID: "1", @@ -385,16 +385,16 @@ func TestResolver(t *testing.T) { }) t.Run("handle_transient_rpc_failure", func(t *testing.T) { - missingTxnID1 := uuid.FastMakeV4() + missingTxnID1 := uuid.MakeV4() statusServer.clear() tcs := []testData{ { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 201, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 901, }, coordinatorNodeID: "2", @@ -405,29 +405,29 @@ func TestResolver(t *testing.T) { TxnFingerprintID: 301, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 902, }, coordinatorNodeID: "3", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 100, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 903, }, coordinatorNodeID: "1", }, { blockingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 101, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 904, }, coordinatorNodeID: "1", @@ -473,7 +473,7 @@ func TestResolver(t *testing.T) { // Throw in a second unresolved contention event where the RPC failure // is happening. - missingTxnID2 := uuid.FastMakeV4() + missingTxnID2 := uuid.MakeV4() tcs = []testData{ { blockingTxn: contentionpb.ResolvedTxnID{ @@ -481,7 +481,7 @@ func TestResolver(t *testing.T) { TxnFingerprintID: 202, }, waitingTxn: contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: 905, }, coordinatorNodeID: "2", diff --git a/pkg/sql/contention/txnidcache/fifo_cache_test.go b/pkg/sql/contention/txnidcache/fifo_cache_test.go index 6e9dae10bd90..060f1855e265 100644 --- a/pkg/sql/contention/txnidcache/fifo_cache_test.go +++ b/pkg/sql/contention/txnidcache/fifo_cache_test.go @@ -141,7 +141,7 @@ func generateInputBlock( expected = make(map[uuid.UUID]appstatspb.TransactionFingerprintID) for i := 0; i < size; i++ { - input[i].TxnID = uuid.FastMakeV4() + input[i].TxnID = uuid.MakeV4() input[i].TxnFingerprintID = appstatspb.TransactionFingerprintID(rand.Uint64()) diff --git a/pkg/sql/contention/txnidcache/txn_id_cache_test.go b/pkg/sql/contention/txnidcache/txn_id_cache_test.go index 7cd7b1b0aae6..e9194d22e26e 100644 --- a/pkg/sql/contention/txnidcache/txn_id_cache_test.go +++ b/pkg/sql/contention/txnidcache/txn_id_cache_test.go @@ -263,11 +263,11 @@ func TestInvalidTxnID(t *testing.T) { inputData := []contentionpb.ResolvedTxnID{ { - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: appstatspb.TransactionFingerprintID(1), }, { - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), TxnFingerprintID: appstatspb.TransactionFingerprintID(2), }, } diff --git a/pkg/sql/contention/txnidcache/writer_test.go b/pkg/sql/contention/txnidcache/writer_test.go index cf98aa628f2a..f4bc1dd40cbd 100644 --- a/pkg/sql/contention/txnidcache/writer_test.go +++ b/pkg/sql/contention/txnidcache/writer_test.go @@ -177,7 +177,7 @@ func TestTxnIDCacheCanBeDisabledViaClusterSetting(t *testing.T) { sink := &counterSink{} w := newWriter(st, sink) w.Record(contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), }) w.DrainWriteBuffer() @@ -187,7 +187,7 @@ func TestTxnIDCacheCanBeDisabledViaClusterSetting(t *testing.T) { MaxSize.Override(ctx, &st.SV, 0) w.Record(contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), }) w.DrainWriteBuffer() require.Equal(t, 1, sink.numOfRecord) @@ -196,7 +196,7 @@ func TestTxnIDCacheCanBeDisabledViaClusterSetting(t *testing.T) { MaxSize.Override(ctx, &st.SV, 1<<10) w.Record(contentionpb.ResolvedTxnID{ - TxnID: uuid.FastMakeV4(), + TxnID: uuid.MakeV4(), }) w.DrainWriteBuffer() require.Equal(t, 2, sink.numOfRecord) diff --git a/pkg/sql/contentionpb/contention_test.go b/pkg/sql/contentionpb/contention_test.go index a00cf616dcdc..f3de817b697f 100644 --- a/pkg/sql/contentionpb/contention_test.go +++ b/pkg/sql/contentionpb/contention_test.go @@ -22,17 +22,17 @@ import ( func TestExtendedContentionEventHash(t *testing.T) { event1 := ExtendedContentionEvent{} - event1.BlockingEvent.TxnMeta.ID = uuid.FastMakeV4() - event1.WaitingTxnID = uuid.FastMakeV4() + event1.BlockingEvent.TxnMeta.ID = uuid.MakeV4() + event1.WaitingTxnID = uuid.MakeV4() event1.WaitingStmtID = clusterunique.ID{Uint128: uint128.Uint128{Lo: 12, Hi: 987}} eventWithDifferentBlockingTxnID := event1 - eventWithDifferentBlockingTxnID.BlockingEvent.TxnMeta.ID = uuid.FastMakeV4() + eventWithDifferentBlockingTxnID.BlockingEvent.TxnMeta.ID = uuid.MakeV4() require.NotEqual(t, eventWithDifferentBlockingTxnID.Hash(), event1.Hash()) eventWithDifferentWaitingTxnID := event1 - eventWithDifferentWaitingTxnID.WaitingTxnID = uuid.FastMakeV4() + eventWithDifferentWaitingTxnID.WaitingTxnID = uuid.MakeV4() require.NotEqual(t, eventWithDifferentWaitingTxnID.Hash(), event1.Hash()) eventWithDifferentStmtId := event1 diff --git a/pkg/sql/crdb_internal_test.go b/pkg/sql/crdb_internal_test.go index b32a06e13ff7..af9db0bd6a69 100644 --- a/pkg/sql/crdb_internal_test.go +++ b/pkg/sql/crdb_internal_test.go @@ -928,13 +928,13 @@ func TestTxnContentionEventsTableWithRangeDescriptor(t *testing.T) { Key: roachpb.Key(rangeKey), TxnMeta: enginepb.TxnMeta{ Key: roachpb.Key(rangeKey), - ID: uuid.FastMakeV4(), + ID: uuid.MakeV4(), }, Duration: 1 * time.Minute, }, BlockingTxnFingerprintID: 9001, - WaitingTxnID: uuid.FastMakeV4(), + WaitingTxnID: uuid.MakeV4(), WaitingTxnFingerprintID: 9002, WaitingStmtID: clusterunique.ID{Uint128: uint128.Uint128{Lo: 9003, Hi: 1004}}, WaitingStmtFingerprintID: 9004, diff --git a/pkg/sql/distsql_physical_planner.go b/pkg/sql/distsql_physical_planner.go index 22e72e7bd6fe..225d833454a3 100644 --- a/pkg/sql/distsql_physical_planner.go +++ b/pkg/sql/distsql_physical_planner.go @@ -4878,7 +4878,7 @@ func (dsp *DistSQLPlanner) NewPlanningCtxWithOracle( localityFiler roachpb.Locality, ) *PlanningCtx { distribute := distributionType == FullDistribution - infra := physicalplan.NewPhysicalInfrastructure(uuid.FastMakeV4(), dsp.gatewaySQLInstanceID) + infra := physicalplan.NewPhysicalInfrastructure(uuid.MakeV4(), dsp.gatewaySQLInstanceID) planCtx := &PlanningCtx{ ExtendedEvalCtx: evalCtx, localityFilter: localityFiler, diff --git a/pkg/sql/distsql_plan_set_op_test.go b/pkg/sql/distsql_plan_set_op_test.go index 1a2ed4eca35a..fbdc3c2bf60a 100644 --- a/pkg/sql/distsql_plan_set_op_test.go +++ b/pkg/sql/distsql_plan_set_op_test.go @@ -60,7 +60,7 @@ func TestMergeResultTypesForSetOp(t *testing.T) { } } } - infra := physicalplan.NewPhysicalInfrastructure(uuid.FastMakeV4(), base.SQLInstanceID(1)) + infra := physicalplan.NewPhysicalInfrastructure(uuid.MakeV4(), base.SQLInstanceID(1)) var leftPlan, rightPlan PhysicalPlan leftPlan.PhysicalInfrastructure = infra rightPlan.PhysicalInfrastructure = infra diff --git a/pkg/sql/distsql_running_test.go b/pkg/sql/distsql_running_test.go index a3bf5c3f48b9..47e9b50322a7 100644 --- a/pkg/sql/distsql_running_test.go +++ b/pkg/sql/distsql_running_test.go @@ -721,7 +721,7 @@ func TestCancelFlowsCoordinator(t *testing.T) { // has 67% probability of participating in the plan. makeFlowsToCancel := func(rng *rand.Rand) map[base.SQLInstanceID]*execinfrapb.FlowSpec { res := make(map[base.SQLInstanceID]*execinfrapb.FlowSpec) - flowID := execinfrapb.FlowID{UUID: uuid.FastMakeV4()} + flowID := execinfrapb.FlowID{UUID: uuid.MakeV4()} for id := 1; id <= numNodes; id++ { if rng.Float64() < 0.33 { // This node wasn't a part of the current plan. diff --git a/pkg/sql/flowinfra/flow_registry_test.go b/pkg/sql/flowinfra/flow_registry_test.go index b2a54ce3b31b..877158806323 100644 --- a/pkg/sql/flowinfra/flow_registry_test.go +++ b/pkg/sql/flowinfra/flow_registry_test.go @@ -675,7 +675,7 @@ func TestFlowCancelPartiallyBlocked(t *testing.T) { // RegisterFlow with an immediate timeout. flow := &FlowBase{ FlowCtx: execinfra.FlowCtx{ - ID: execinfrapb.FlowID{UUID: uuid.FastMakeV4()}, + ID: execinfrapb.FlowID{UUID: uuid.MakeV4()}, }, inboundStreams: inboundStreams, flowRegistry: fr, diff --git a/pkg/sql/jobs_profiler_execution_details_test.go b/pkg/sql/jobs_profiler_execution_details_test.go index beb65a2d4c50..7821d8e1c65d 100644 --- a/pkg/sql/jobs_profiler_execution_details_test.go +++ b/pkg/sql/jobs_profiler_execution_details_test.go @@ -132,7 +132,7 @@ func TestShowJobsWithExecutionDetails(t *testing.T) { return fakeExecResumer{ OnResume: func(ctx context.Context) error { p := sql.PhysicalPlan{} - infra := physicalplan.NewPhysicalInfrastructure(uuid.FastMakeV4(), base.SQLInstanceID(1)) + infra := physicalplan.NewPhysicalInfrastructure(uuid.MakeV4(), base.SQLInstanceID(1)) p.PhysicalInfrastructure = infra jobsprofiler.StorePlanDiagram(ctx, s.Stopper(), &p, s.InternalDB().(isql.DB), j.ID()) checkForPlanDiagrams(ctx, t, s.InternalDB().(isql.DB), j.ID(), 1) @@ -183,7 +183,7 @@ func TestReadWriteProfilerExecutionDetails(t *testing.T) { return fakeExecResumer{ OnResume: func(ctx context.Context) error { p := sql.PhysicalPlan{} - infra := physicalplan.NewPhysicalInfrastructure(uuid.FastMakeV4(), base.SQLInstanceID(1)) + infra := physicalplan.NewPhysicalInfrastructure(uuid.MakeV4(), base.SQLInstanceID(1)) p.PhysicalInfrastructure = infra jobsprofiler.StorePlanDiagram(ctx, s.Stopper(), &p, s.InternalDB().(isql.DB), j.ID()) checkForPlanDiagrams(ctx, t, s.InternalDB().(isql.DB), j.ID(), 1) @@ -346,7 +346,7 @@ func TestListProfilerExecutionDetails(t *testing.T) { return fakeExecResumer{ OnResume: func(ctx context.Context) error { p := sql.PhysicalPlan{} - infra := physicalplan.NewPhysicalInfrastructure(uuid.FastMakeV4(), base.SQLInstanceID(1)) + infra := physicalplan.NewPhysicalInfrastructure(uuid.MakeV4(), base.SQLInstanceID(1)) p.PhysicalInfrastructure = infra jobsprofiler.StorePlanDiagram(ctx, s.Stopper(), &p, s.InternalDB().(isql.DB), j.ID()) checkForPlanDiagrams(ctx, t, s.InternalDB().(isql.DB), j.ID(), expectedDiagrams) diff --git a/pkg/sql/physicalplan/aggregator_funcs_test.go b/pkg/sql/physicalplan/aggregator_funcs_test.go index 614f5917a043..11970becfc66 100644 --- a/pkg/sql/physicalplan/aggregator_funcs_test.go +++ b/pkg/sql/physicalplan/aggregator_funcs_test.go @@ -75,7 +75,7 @@ func runTestFlow( Version: execinfra.Version, LeafTxnInputState: leafInputState, Flow: execinfrapb.FlowSpec{ - FlowID: execinfrapb.FlowID{UUID: uuid.FastMakeV4()}, + FlowID: execinfrapb.FlowID{UUID: uuid.MakeV4()}, Processors: procs, }, } diff --git a/pkg/sql/sql_activity_update_job_test.go b/pkg/sql/sql_activity_update_job_test.go index 56831b87119d..00efcbbbcf69 100644 --- a/pkg/sql/sql_activity_update_job_test.go +++ b/pkg/sql/sql_activity_update_job_test.go @@ -642,7 +642,7 @@ func TestActivityStatusCombineAPI(t *testing.T) { db := sqlutils.MakeSQLRunner(sqlDB) db.Exec(t, `SET CLUSTER SETTING sql.stats.activity.flush.enabled = true;`) // Generate a random app name each time to avoid conflicts - appName := "test_status_api" + uuid.FastMakeV4().String() + appName := "test_status_api" + uuid.MakeV4().String() db.Exec(t, "SET SESSION application_name = $1", appName) // Generate some sql stats data. diff --git a/pkg/sql/sqlliveness/slstorage/sessionid_test.go b/pkg/sql/sqlliveness/slstorage/sessionid_test.go index 3a78062d68cb..0b4ed821eaab 100644 --- a/pkg/sql/sqlliveness/slstorage/sessionid_test.go +++ b/pkg/sql/sqlliveness/slstorage/sessionid_test.go @@ -27,9 +27,9 @@ func FuzzSessionIDEncoding(f *testing.F) { defer log.Scope(f).Close(f) f.Add(string("")) - f.Add(string(uuid.FastMakeV4().GetBytes())) + f.Add(string(uuid.MakeV4().GetBytes())) - session, err := slstorage.MakeSessionID(enum.One, uuid.FastMakeV4()) + session, err := slstorage.MakeSessionID(enum.One, uuid.MakeV4()) require.NoError(f, err) f.Add(string(session)) diff --git a/pkg/sql/sqlstats/insights/registry_test.go b/pkg/sql/sqlstats/insights/registry_test.go index c0a2e250996c..62b8b4287140 100644 --- a/pkg/sql/sqlstats/insights/registry_test.go +++ b/pkg/sql/sqlstats/insights/registry_test.go @@ -46,7 +46,7 @@ func TestRegistry(t *testing.T) { session := Session{ID: clusterunique.IDFromBytes([]byte("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"))} t.Run("slow detection", func(t *testing.T) { - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} statement := &Statement{ Status: Statement_Completed, ID: clusterunique.IDFromBytes([]byte("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")), @@ -83,7 +83,7 @@ func TestRegistry(t *testing.T) { t.Run("failure detection", func(t *testing.T) { // Verify that statement error info gets bubbled up to the transaction // when the transaction does not have this information. - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} statement := &Statement{ ID: clusterunique.IDFromBytes([]byte("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")), FingerprintID: appstatspb.StmtFingerprintID(100), @@ -128,7 +128,7 @@ func TestRegistry(t *testing.T) { }) t.Run("disabled", func(t *testing.T) { - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} statement := &Statement{ Status: Statement_Completed, ID: clusterunique.IDFromBytes([]byte("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")), @@ -153,7 +153,7 @@ func TestRegistry(t *testing.T) { }) t.Run("too fast", func(t *testing.T) { - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} st := cluster.MakeTestingClusterSettings() LatencyThreshold.Override(ctx, &st.SV, 1*time.Second) statement2 := &Statement{ @@ -177,7 +177,7 @@ func TestRegistry(t *testing.T) { }) t.Run("buffering statements per session", func(t *testing.T) { - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} statement := &Statement{ Status: Statement_Completed, ID: clusterunique.IDFromBytes([]byte("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")), @@ -185,7 +185,7 @@ func TestRegistry(t *testing.T) { LatencyInSeconds: 2, } otherSession := Session{ID: clusterunique.IDFromBytes([]byte("cccccccccccccccccccccccccccccccc"))} - otherTransaction := &Transaction{ID: uuid.FastMakeV4()} + otherTransaction := &Transaction{ID: uuid.MakeV4()} otherStatement := &Statement{ ID: clusterunique.IDFromBytes([]byte("dddddddddddddddddddddddddddddddd")), FingerprintID: appstatspb.StmtFingerprintID(101), @@ -231,7 +231,7 @@ func TestRegistry(t *testing.T) { }) t.Run("sibling statements without problems", func(t *testing.T) { - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} statement := &Statement{ Status: Statement_Completed, ID: clusterunique.IDFromBytes([]byte("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")), @@ -274,14 +274,14 @@ func TestRegistry(t *testing.T) { }) t.Run("txn with no stmts", func(t *testing.T) { - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} st := cluster.MakeTestingClusterSettings() registry := newRegistry(st, &latencyThresholdDetector{st: st}, newStore(st)) require.NotPanics(t, func() { registry.ObserveTransaction(session.ID, transaction) }) }) t.Run("txn with high accumulated contention without high single stmt contention", func(t *testing.T) { - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} st := cluster.MakeTestingClusterSettings() store := newStore(st) registry := newRegistry(st, &latencyThresholdDetector{st: st}, store) @@ -292,7 +292,7 @@ func TestRegistry(t *testing.T) { FingerprintID: appstatspb.StmtFingerprintID(100), LatencyInSeconds: 0.00001, } - txnHighContention := &Transaction{ID: uuid.FastMakeV4(), Contention: &contentionDuration} + txnHighContention := &Transaction{ID: uuid.MakeV4(), Contention: &contentionDuration} registry.ObserveStatement(session.ID, statement) registry.ObserveTransaction(session.ID, txnHighContention) @@ -325,7 +325,7 @@ func TestRegistry(t *testing.T) { }) t.Run("statement that is slow but should be ignored", func(t *testing.T) { - transaction := &Transaction{ID: uuid.FastMakeV4()} + transaction := &Transaction{ID: uuid.MakeV4()} statementNotIgnored := &Statement{ Status: Statement_Completed, ID: clusterunique.IDFromBytes([]byte("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb")), diff --git a/pkg/sql/sqlstats/insights/store_test.go b/pkg/sql/sqlstats/insights/store_test.go index 48edc96263f2..5b2bbc8d9d78 100644 --- a/pkg/sql/sqlstats/insights/store_test.go +++ b/pkg/sql/sqlstats/insights/store_test.go @@ -43,7 +43,7 @@ func TestStore(t *testing.T) { func addInsight(store *lockingStore, idBase uint64) { store.AddInsight(&Insight{ Transaction: &Transaction{ - ID: uuid.FastMakeV4(), + ID: uuid.MakeV4(), }, Statements: []*Statement{{ID: clusterunique.ID{Uint128: uint128.FromInts(0, idBase)}}}, }) diff --git a/pkg/sql/sqlstats/persistedsqlstats/flush_test.go b/pkg/sql/sqlstats/persistedsqlstats/flush_test.go index c5286c89677a..1d8ab3a87ffe 100644 --- a/pkg/sql/sqlstats/persistedsqlstats/flush_test.go +++ b/pkg/sql/sqlstats/persistedsqlstats/flush_test.go @@ -779,7 +779,7 @@ func TestSQLStatsPlanSampling(t *testing.T) { dbName := "defaultdb" - appName := fmt.Sprintf("TestSQLStatsPlanSampling_%s", uuid.FastMakeV4().String()) + appName := fmt.Sprintf("TestSQLStatsPlanSampling_%s", uuid.MakeV4().String()) sqlRun.Exec(t, "SET application_name = $1", appName) sqlStats := s.SQLServer().(*sql.Server).GetSQLStatsProvider().(*persistedsqlstats.PersistedSQLStats) diff --git a/pkg/util/uuid/benchmark_fast_test.go b/pkg/util/uuid/benchmark_fast_test.go index d9196b51ac66..e91fc38ac01f 100644 --- a/pkg/util/uuid/benchmark_fast_test.go +++ b/pkg/util/uuid/benchmark_fast_test.go @@ -16,26 +16,12 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/uuid" ) -func BenchmarkFastMakeV4(b *testing.B) { - for i := 0; i < b.N; i++ { - uuid.FastMakeV4() - } -} - func BenchmarkMakeV4(b *testing.B) { for i := 0; i < b.N; i++ { uuid.MakeV4() } } -func BenchmarkConcurrentFastMakeV4(b *testing.B) { - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - uuid.FastMakeV4() - } - }) -} - func BenchmarkConcurrentMakeV4(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { diff --git a/pkg/util/uuid/generator_test.go b/pkg/util/uuid/generator_test.go index fc02a5a66727..f6eb3990ebd4 100644 --- a/pkg/util/uuid/generator_test.go +++ b/pkg/util/uuid/generator_test.go @@ -360,12 +360,7 @@ func BenchmarkGenerator(b *testing.B) { }) b.Run("V4", func(b *testing.B) { for i := 0; i < b.N; i++ { - Must(NewV4()) - } - }) - b.Run("FastV4", func(b *testing.B) { - for i := 0; i < b.N; i++ { - FastMakeV4() + MakeV4() } }) b.Run("V5", func(b *testing.B) { diff --git a/pkg/util/uuid/uuid_wrapper.go b/pkg/util/uuid/uuid_wrapper.go index 68b99f3a8b20..5478b9fe462a 100644 --- a/pkg/util/uuid/uuid_wrapper.go +++ b/pkg/util/uuid/uuid_wrapper.go @@ -99,16 +99,6 @@ func MakeV4() UUID { return Must(NewV4()) } -// FastMakeV4 generates a UUID using a fast but not cryptographically secure -// source of randomness. -func FastMakeV4() UUID { - u, err := fastGen.NewV4() - if err != nil { - panic(errors.Wrap(err, "should never happen with math/rand.Rand")) - } - return u -} - // mathRandReader is an io.Reader that calls through to "math/rand".Read // which is safe for concurrent use. type mathRandReader struct{} @@ -120,9 +110,6 @@ func (r mathRandReader) Read(p []byte) (n int, err error) { return math_rand.Read(p) } -// fastGen is a non-cryptographically secure Generator. -var fastGen = NewGenWithReader(mathRandReader{}) - // NewPopulatedUUID returns a populated UUID. func NewPopulatedUUID(r interface { Uint32() uint32