diff --git a/pkg/storage/concurrency/concurrency_manager_test.go b/pkg/storage/concurrency/concurrency_manager_test.go index 7c6c47608b85..477fb423a083 100644 --- a/pkg/storage/concurrency/concurrency_manager_test.go +++ b/pkg/storage/concurrency/concurrency_manager_test.go @@ -40,7 +40,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/syncutil" "github.com/cockroachdb/cockroach/pkg/util/tracing" - "github.com/cockroachdb/cockroach/pkg/util/uint128" "github.com/cockroachdb/cockroach/pkg/util/uuid" "github.com/cockroachdb/datadriven" "github.com/cockroachdb/errors" @@ -333,7 +332,7 @@ type cluster struct { m concurrency.Manager // Definitions. - txnCounter uint128.Uint128 + txnCounter uint32 txnsByName map[string]*roachpb.Transaction requestsByName map[string]concurrency.Request @@ -380,7 +379,7 @@ func (c *cluster) makeConfig() concurrency.Config { func (c *cluster) PushTransaction( ctx context.Context, pushee *enginepb.TxnMeta, h roachpb.Header, pushType roachpb.PushTxnType, ) (roachpb.Transaction, *roachpb.Error) { - log.Eventf(ctx, "pushing txn %s", pushee.ID) + log.Eventf(ctx, "pushing txn %s", pushee.ID.Short()) pusheeRecord, err := c.getTxnRecord(pushee.ID) if err != nil { return roachpb.Transaction{}, roachpb.NewError(err) @@ -410,7 +409,7 @@ func (c *cluster) PushTransaction( func (c *cluster) ResolveIntent( ctx context.Context, intent roachpb.LockUpdate, _ intentresolver.ResolveOptions, ) *roachpb.Error { - log.Eventf(ctx, "resolving intent %s for txn %s with %s status", intent.Key, intent.Txn.ID, intent.Status) + log.Eventf(ctx, "resolving intent %s for txn %s with %s status", intent.Key, intent.Txn.ID.Short(), intent.Status) c.m.OnLockUpdated(ctx, &intent) return nil } diff --git a/pkg/storage/concurrency/datadriven_util_test.go b/pkg/storage/concurrency/datadriven_util_test.go index 360c027b0ab3..dee090e30bdb 100644 --- a/pkg/storage/concurrency/datadriven_util_test.go +++ b/pkg/storage/concurrency/datadriven_util_test.go @@ -22,9 +22,10 @@ import ( "github.com/cockroachdb/datadriven" ) -func nextUUID(counter *uint128.Uint128) uuid.UUID { - *counter = counter.Add(1) - return uuid.FromUint128(*counter) +func nextUUID(counter *uint32) uuid.UUID { + *counter = *counter + 1 + hi := uint64(*counter) << 32 + return uuid.FromUint128(uint128.Uint128{Hi: hi}) } func scanTimestamp(t *testing.T, d *datadriven.TestData) hlc.Timestamp { diff --git a/pkg/storage/concurrency/testdata/concurrency_manager/basic b/pkg/storage/concurrency/testdata/concurrency_manager/basic index a0d24d11c23e..43a4bb52aced 100644 --- a/pkg/storage/concurrency/testdata/concurrency_manager/basic +++ b/pkg/storage/concurrency/testdata/concurrency_manager/basic @@ -58,7 +58,7 @@ debug-lock-table ---- global: num=1 lock: "k" - holder: txn: 00000000-0000-0000-0000-000000000002, ts: 0.000000012,1 + holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000012,1 local: num=0 finish req=req2 @@ -69,7 +69,7 @@ debug-lock-table ---- global: num=1 lock: "k" - holder: txn: 00000000-0000-0000-0000-000000000002, ts: 0.000000012,1 + holder: txn: 00000002-0000-0000-0000-000000000000, ts: 0.000000012,1 local: num=0 reset @@ -105,13 +105,13 @@ sequence req=req3 [1] sequence req3: acquiring latches [1] sequence req3: scanning lock table for conflicting locks [1] sequence req3: waiting in lock wait-queues -[1] sequence req3: pushing txn 00000000-0000-0000-0000-000000000002 +[1] sequence req3: pushing txn 00000002 [1] sequence req3: blocked on sync.Cond.Wait in concurrency_test.(*cluster).PushTransaction on-txn-updated txn=txn2 status=committed ---- [-] update txn: committing txn2 -[1] sequence req3: resolving intent "k" for txn 00000000-0000-0000-0000-000000000002 with COMMITTED status +[1] sequence req3: resolving intent "k" for txn 00000002 with COMMITTED status [1] sequence req3: acquiring latches [1] sequence req3: scanning lock table for conflicting locks [1] sequence req3: sequencing complete, returned guard @@ -174,7 +174,7 @@ sequence req=req5 [1] sequence req5: acquiring latches [1] sequence req5: scanning lock table for conflicting locks [1] sequence req5: waiting in lock wait-queues -[1] sequence req5: pushing txn 00000000-0000-0000-0000-000000000002 +[1] sequence req5: pushing txn 00000002 [1] sequence req5: blocked on sync.Cond.Wait in concurrency_test.(*cluster).PushTransaction new-request name=req6 txn=none ts=16,1 @@ -192,7 +192,7 @@ sequence req=req6 on-txn-updated txn=txn2 status=pending ts=18,1 ---- [-] update txn: increasing timestamp of txn2 -[1] sequence req5: resolving intent "k" for txn 00000000-0000-0000-0000-000000000002 with PENDING status +[1] sequence req5: resolving intent "k" for txn 00000002 with PENDING status [1] sequence req5: acquiring latches [1] sequence req5: scanning lock table for conflicting locks [1] sequence req5: sequencing complete, returned guard @@ -219,13 +219,13 @@ finish req=req6 [-] finish req6: finishing request [3] sequence req7: scanning lock table for conflicting locks [3] sequence req7: waiting in lock wait-queues -[3] sequence req7: pushing txn 00000000-0000-0000-0000-000000000002 +[3] sequence req7: pushing txn 00000002 [3] sequence req7: blocked on sync.Cond.Wait in concurrency_test.(*cluster).PushTransaction on-txn-updated txn=txn2 status=committed ---- [-] update txn: committing txn2 -[3] sequence req7: resolving intent "k" for txn 00000000-0000-0000-0000-000000000002 with COMMITTED status +[3] sequence req7: resolving intent "k" for txn 00000002 with COMMITTED status [3] sequence req7: acquiring latches [3] sequence req7: scanning lock table for conflicting locks [3] sequence req7: sequencing complete, returned guard diff --git a/pkg/storage/concurrency/testdata/concurrency_manager/discovered_lock b/pkg/storage/concurrency/testdata/concurrency_manager/discovered_lock index f6649145d4d2..05c7abc6cc55 100644 --- a/pkg/storage/concurrency/testdata/concurrency_manager/discovered_lock +++ b/pkg/storage/concurrency/testdata/concurrency_manager/discovered_lock @@ -28,7 +28,7 @@ debug-lock-table ---- global: num=1 lock: "k" - holder: txn: 00000000-0000-0000-0000-000000000001, ts: 0.000000010,1 + holder: txn: 00000001-0000-0000-0000-000000000000, ts: 0.000000010,1 local: num=0 sequence req=req1 @@ -37,13 +37,13 @@ sequence req=req1 [2] sequence req1: acquiring latches [2] sequence req1: scanning lock table for conflicting locks [2] sequence req1: waiting in lock wait-queues -[2] sequence req1: pushing txn 00000000-0000-0000-0000-000000000001 +[2] sequence req1: pushing txn 00000001 [2] sequence req1: blocked on sync.Cond.Wait in concurrency_test.(*cluster).PushTransaction on-txn-updated txn=txn1 status=aborted ---- [-] update txn: aborting txn1 -[2] sequence req1: resolving intent "k" for txn 00000000-0000-0000-0000-000000000001 with ABORTED status +[2] sequence req1: resolving intent "k" for txn 00000001 with ABORTED status [2] sequence req1: acquiring latches [2] sequence req1: scanning lock table for conflicting locks [2] sequence req1: sequencing complete, returned guard