Skip to content

Commit

Permalink
*: rename FastMakeV4 to MakeV4
Browse files Browse the repository at this point in the history
There's no need for a separate FastMakeV4 function now; it's the same as
MakeV4.

Release note: None
  • Loading branch information
rafiss committed May 22, 2024
1 parent 087ff82 commit c64b755
Show file tree
Hide file tree
Showing 39 changed files with 111 additions and 143 deletions.
2 changes: 1 addition & 1 deletion pkg/ccl/backupccl/tenant_backup_nemesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/debug_recover_loss_of_quorum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/tests/mvcc_gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/jobs/jobsprofiler/profiler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/batcheval/declare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
Expand Down
6 changes: 3 additions & 3 deletions pkg/kv/kvserver/gc/gc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/kvstorage/datadriven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}))
Expand Down
8 changes: 4 additions & 4 deletions pkg/kv/kvserver/loqrecovery/loqrecoverypb/recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}},
Expand Down Expand Up @@ -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}},
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/loqrecovery/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/loqrecovery/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
14 changes: 7 additions & 7 deletions pkg/kv/kvserver/replica_consistency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -190,15 +190,15 @@ 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)
require.ErrorContains(t, err, "checksum task failed to start")
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 {
Expand All @@ -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() {}
Expand All @@ -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)
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/roachpb/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/down_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion pkg/server/distsql_flows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/catalog/schematelemetry/schema_telemetry_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/catalog/systemschema_test/systemschema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/colcontainer/diskqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions pkg/sql/contention/event_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ func TestCollectionThreshold(t *testing.T) {
{
BlockingEvent: kvpb.ContentionEvent{
TxnMeta: enginepb.TxnMeta{
ID: uuid.FastMakeV4(),
ID: uuid.MakeV4(),
},
Duration: 10 * time.Millisecond,
},
},
{
BlockingEvent: kvpb.ContentionEvent{
TxnMeta: enginepb.TxnMeta{
ID: uuid.FastMakeV4(),
ID: uuid.MakeV4(),
},
Duration: 2 * time.Second,
},
Expand Down Expand Up @@ -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{})
Expand Down Expand Up @@ -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)),
Expand Down
Loading

0 comments on commit c64b755

Please sign in to comment.