From 5f80e3537fdb90d158219e9516b499d4508a36fc Mon Sep 17 00:00:00 2001 From: Nathan VanBenschoten Date: Mon, 5 Jun 2023 15:25:54 -0400 Subject: [PATCH] kv: include txn isolation level in kvnemesis operation name This improves debuggability of kvnemesis runs. Epic: None Release note: None --- ...saction_committed_but_has_validation_error | 2 +- ...saction_committed_but_has_validation_error | 2 +- ...one_deleterange_after_write_extra_deletion | 2 +- .../one_deleterange_after_write_missing_write | 2 +- ...rites_returning_keys_outside_span_boundary | 2 +- ...eleterange_after_writes_with_missing_write | 2 +- ...r_writes_with_write_timestamp_disagreement | 2 +- ...er_writes_and_delete_returning_missing_key | 2 +- ...r_writes_with_write_timestamp_disagreement | 2 +- ...r_writes_with_write_timestamp_disagreement | 2 +- ...scan_followed_by_delete_outside_time_range | 2 +- ..._committed_delete_with_first_write_missing | 2 +- ...committed_delete_with_second_write_missing | 2 +- ...d_delete_with_write_timestamp_disagreement | 2 +- ...lly_committed_put_with_first_write_missing | 2 +- ...ly_committed_put_with_second_write_missing | 2 +- ...tted_put_with_write_timestamp_disagreement | 2 +- ...back_delete_with_write_incorrectly_present | 2 +- ...ed_back_put_with_write_incorrectly_present | 2 +- ...ansaction_with_incorrect_read_after_delete | 2 +- ...ransaction_with_incorrect_read_after_write | 2 +- ...nsaction_with_incorrect_read_before_delete | 2 +- ...ansaction_with_incorrect_read_before_write | 2 +- ...ransaction_with_incorrect_scan_after_write | 2 +- ...ansaction_with_incorrect_scan_before_write | 2 +- ...nal_read_and_write_with_empty_time_overlap | 2 +- ...writes_and_deletes_with_empty_time_overlap | 2 +- ...eletes_after_write_with_empty_time_overlap | 2 +- ..._reads_one_missing_with_empty_time_overlap | 2 +- ...ransactional_reads_with_empty_time_overlap | 2 +- ...nal_scan_and_write_with_empty_time_overlap | 2 +- ...scans_after_delete_with_empty_time_overlap | 2 +- ..._scans_one_missing_with_empty_time_overlap | 2 +- ...ransactional_scans_with_empty_time_overlap | 2 +- ...te_ops_of_the_same_key_with_incorrect_read | 2 +- pkg/kv/kvnemesis/validator.go | 5 ++-- .../concurrency/isolation/BUILD.bazel | 1 + .../kvserver/concurrency/isolation/levels.go | 19 ++++++++++++++ .../concurrency/isolation/levels_test.go | 26 +++++++++++++++++++ 39 files changed, 83 insertions(+), 38 deletions(-) diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/ambiguous_put-del_transaction_committed_but_has_validation_error b/pkg/kv/kvnemesis/testdata/TestValidate/ambiguous_put-del_transaction_committed_but_has_validation_error index 116530257a3f..d587595c379d 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/ambiguous_put-del_transaction_committed_but_has_validation_error +++ b/pkg/kv/kvnemesis/testdata/TestValidate/ambiguous_put-del_transaction_committed_but_has_validation_error @@ -8,4 +8,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { }) // result is ambiguous: boom /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000002"/0.000000002,0 @ s2 -ambiguous txn non-atomic timestamps: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [d]/Table/100/"0000000000000002":0.000000002,0->@s2 +ambiguous serializable txn non-atomic timestamps: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [d]/Table/100/"0000000000000002":0.000000002,0->@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/ambiguous_put-put_transaction_committed_but_has_validation_error b/pkg/kv/kvnemesis/testdata/TestValidate/ambiguous_put-put_transaction_committed_but_has_validation_error index a49862bab160..1f83978abe78 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/ambiguous_put-put_transaction_committed_but_has_validation_error +++ b/pkg/kv/kvnemesis/testdata/TestValidate/ambiguous_put-put_transaction_committed_but_has_validation_error @@ -8,4 +8,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { }) // result is ambiguous: boom /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000002"/0.000000002,0 @ s2 v2 -ambiguous txn non-atomic timestamps: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [w]/Table/100/"0000000000000002":0.000000002,0->v2@s2 +ambiguous serializable txn non-atomic timestamps: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [w]/Table/100/"0000000000000002":0.000000002,0->v2@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_write_extra_deletion b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_write_extra_deletion index 235c79c9c363..8c9346712c6e 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_write_extra_deletion +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_write_extra_deletion @@ -9,4 +9,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s2 mismatched write timestamp 0.000000001,0 and exec timestamp 0.000000002,0: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 -committed txn missing write at seq s2: [dr.d]/Table/100/"0000000000000001":0.000000002,0->@s2 [dr.d]/Table/100/"0000000000000002":missing->@s2 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000002,0, )}->[] +committed serializable txn missing write at seq s2: [dr.d]/Table/100/"0000000000000001":0.000000002,0->@s2 [dr.d]/Table/100/"0000000000000002":missing->@s2 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000002,0, )}->[] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_write_missing_write b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_write_missing_write index 39c75e4cb68c..d33dc3f2e3f1 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_write_missing_write +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_write_missing_write @@ -7,4 +7,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 -committed txn missing write at seq s2: [dr.d]/Table/100/"0000000000000001":missing->@s2 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0)}->[] +committed serializable txn missing write at seq s2: [dr.d]/Table/100/"0000000000000001":missing->@s2 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0)}->[] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_returning_keys_outside_span_boundary b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_returning_keys_outside_span_boundary index 623d36134c44..7ea5742a500d 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_returning_keys_outside_span_boundary +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_returning_keys_outside_span_boundary @@ -10,4 +10,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000003,0 @ s3 /Table/100/"0000000000000004"/0.000000002,0 @ s2 v2 -committed txn missing write at seq s3: [dr.d]/Table/100/"0000000000000001":0.000000003,0->@s3 [dr.d]/Table/100/"0000000000000004":missing->@s3 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000003,0, )}->[] +committed serializable txn missing write at seq s3: [dr.d]/Table/100/"0000000000000001":0.000000003,0->@s3 [dr.d]/Table/100/"0000000000000004":missing->@s3 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000003,0, )}->[] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_with_missing_write b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_with_missing_write index a9f0e1a544b4..3a7a64b09d18 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_with_missing_write +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_with_missing_write @@ -13,5 +13,5 @@ db0.Scan(ctx, tk(1), tk(4), 0) // @0.000000005,0 (/Table/100/"0000000000000003": /Table/100/"0000000000000002"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000003"/0.000000003,0 @ s3 v3 /Table/100/"0000000000000001"/0.000000004,0 @ s4 -committed txn missing write at seq s4: [dr.d]/Table/100/"0000000000000001":0.000000004,0->@s4 [dr.d]/Table/100/"0000000000000002":missing->@s4 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000004,0, )}->[] +committed serializable txn missing write at seq s4: [dr.d]/Table/100/"0000000000000001":0.000000004,0->@s4 [dr.d]/Table/100/"0000000000000002":missing->@s4 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000004,0, )}->[] committed scan non-atomic timestamps: [s]/Table/100/"000000000000000{1"-4"}:{0:[0.000000003,0, ), gap:[, 0.000000001,0)}->[/Table/100/"0000000000000003":v3] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_with_write_timestamp_disagreement b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_with_write_timestamp_disagreement index 19c1b0ce351e..4dd1ba514446 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_with_write_timestamp_disagreement +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_deleterange_after_writes_with_write_timestamp_disagreement @@ -14,4 +14,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000003,0 @ s4 /Table/100/"0000000000000002"/0.000000004,0 @ s4 /Table/100/"0000000000000003"/0.000000004,0 @ s4 -committed txn non-atomic timestamps: [dr.d]/Table/100/"0000000000000001":0.000000003,0->@s4 [dr.d]/Table/100/"0000000000000002":0.000000004,0->@s4 [dr.d]/Table/100/"0000000000000003":0.000000004,0->@s4 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000004,0, )}->[] +committed serializable txn non-atomic timestamps: [dr.d]/Table/100/"0000000000000001":0.000000003,0->@s4 [dr.d]/Table/100/"0000000000000002":0.000000004,0->@s4 [dr.d]/Table/100/"0000000000000003":0.000000004,0->@s4 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000004,0, )}->[] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_scan_after_writes_and_delete_returning_missing_key b/pkg/kv/kvnemesis/testdata/TestValidate/one_scan_after_writes_and_delete_returning_missing_key index 94a5a390f9fe..4cc88dd0e8a3 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_scan_after_writes_and_delete_returning_missing_key +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_scan_after_writes_and_delete_returning_missing_key @@ -19,4 +19,4 @@ db0.Del(ctx, tk(1) /* @s5 */) // @0.000000004,0 /Table/100/"0000000000000001"/0.000000002,0 @ s3 /Table/100/"0000000000000001"/0.000000003,0 @ s4 v4 /Table/100/"0000000000000001"/0.000000004,0 @ s5 -committed txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, ), gap:[, 0.000000001,0),[0.000000004,0, )}->[/Table/100/"0000000000000002":v2] [d]/Table/100/"0000000000000001":0.000000002,0->@s3 +committed serializable txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, ), gap:[, 0.000000001,0),[0.000000004,0, )}->[/Table/100/"0000000000000002":v2] [d]/Table/100/"0000000000000001":0.000000002,0->@s3 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_deleterange_followed_by_put_after_writes_with_write_timestamp_disagreement b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_deleterange_followed_by_put_after_writes_with_write_timestamp_disagreement index 8cbc3ce11cee..fd4ef0c3b155 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_deleterange_followed_by_put_after_writes_with_write_timestamp_disagreement +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_deleterange_followed_by_put_after_writes_with_write_timestamp_disagreement @@ -10,4 +10,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s2 /Table/100/"0000000000000002"/0.000000003,0 @ s3 v3 -committed txn non-atomic timestamps: [dr.d]/Table/100/"0000000000000001":0.000000002,0->@s2 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000003,0, )}->[] [w]/Table/100/"0000000000000002":0.000000003,0->v3@s3 +committed serializable txn non-atomic timestamps: [dr.d]/Table/100/"0000000000000001":0.000000002,0->@s2 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000003,0, )}->[] [w]/Table/100/"0000000000000002":0.000000003,0->v3@s3 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_put_shadowed_by_deleterange_after_writes_with_write_timestamp_disagreement b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_put_shadowed_by_deleterange_after_writes_with_write_timestamp_disagreement index 9020ef9fe5af..4f53e2a65eaf 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_put_shadowed_by_deleterange_after_writes_with_write_timestamp_disagreement +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_put_shadowed_by_deleterange_after_writes_with_write_timestamp_disagreement @@ -10,4 +10,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s3 /Table/100/"0000000000000002"/0.000000003,0 @ s3 -committed txn non-atomic timestamps: [w]/Table/100/"0000000000000002":missing->v2@s2 [dr.d]/Table/100/"0000000000000001":0.000000002,0->@s3 [dr.d]/Table/100/"0000000000000002":0.000000003,0->@s3 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000003,0, )}->[] +committed serializable txn non-atomic timestamps: [w]/Table/100/"0000000000000002":missing->v2@s2 [dr.d]/Table/100/"0000000000000001":0.000000002,0->@s3 [dr.d]/Table/100/"0000000000000002":0.000000003,0->@s3 [dr.s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0),[0.000000003,0, )}->[] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_scan_followed_by_delete_outside_time_range b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_scan_followed_by_delete_outside_time_range index f302253f087d..4bd01808ea89 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_scan_followed_by_delete_outside_time_range +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactional_scan_followed_by_delete_outside_time_range @@ -11,4 +11,4 @@ db0.Put(ctx, tk(2), sv(3)) // @0.000000003,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000004,0 @ s2 /Table/100/"0000000000000002"/0.000000003,0 @ s3 v3 -committed txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, ), gap:[, 0.000000003,0)}->[/Table/100/"0000000000000001":v1] [d]/Table/100/"0000000000000001":0.000000004,0->@s2 +committed serializable txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, ), gap:[, 0.000000003,0)}->[/Table/100/"0000000000000001":v1] [d]/Table/100/"0000000000000001":0.000000004,0->@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_first_write_missing b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_first_write_missing index 9e99801fb8c8..5e4e679bc262 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_first_write_missing +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_first_write_missing @@ -7,4 +7,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000002"/0.000000001,0 @ s2 -committed txn missing write at seq s1: [d]/Table/100/"0000000000000001":missing->@s1 [d]/Table/100/"0000000000000002":0.000000001,0->@s2 +committed serializable txn missing write at seq s1: [d]/Table/100/"0000000000000001":missing->@s1 [d]/Table/100/"0000000000000002":0.000000001,0->@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_second_write_missing b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_second_write_missing index 816e7bdd8746..6e1c9fcae4a4 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_second_write_missing +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_second_write_missing @@ -7,4 +7,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 -committed txn missing write at seq s2: [d]/Table/100/"0000000000000001":0.000000001,0->@s1 [d]/Table/100/"0000000000000002":missing->@s2 +committed serializable txn missing write at seq s2: [d]/Table/100/"0000000000000001":0.000000001,0->@s1 [d]/Table/100/"0000000000000002":missing->@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_write_timestamp_disagreement b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_write_timestamp_disagreement index 7f046513d277..994a4c2fa856 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_write_timestamp_disagreement +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_delete_with_write_timestamp_disagreement @@ -8,4 +8,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 /Table/100/"0000000000000002"/0.000000002,0 @ s2 -committed txn non-atomic timestamps: [d]/Table/100/"0000000000000001":0.000000001,0->@s1 [d]/Table/100/"0000000000000002":0.000000002,0->@s2 +committed serializable txn non-atomic timestamps: [d]/Table/100/"0000000000000001":0.000000001,0->@s1 [d]/Table/100/"0000000000000002":0.000000002,0->@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_first_write_missing b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_first_write_missing index de424fe4b38a..46cc43ae032a 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_first_write_missing +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_first_write_missing @@ -7,4 +7,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000002"/0.000000001,0 @ s2 v2 -committed txn missing write at seq s1: [w]/Table/100/"0000000000000001":missing->v1@s1 [w]/Table/100/"0000000000000002":0.000000001,0->v2@s2 +committed serializable txn missing write at seq s1: [w]/Table/100/"0000000000000001":missing->v1@s1 [w]/Table/100/"0000000000000002":0.000000001,0->v2@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_second_write_missing b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_second_write_missing index 6feb2cd3060e..3c9b7f2461c1 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_second_write_missing +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_second_write_missing @@ -7,4 +7,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 -committed txn missing write at seq s2: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [w]/Table/100/"0000000000000002":missing->v2@s2 +committed serializable txn missing write at seq s2: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [w]/Table/100/"0000000000000002":missing->v2@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_write_timestamp_disagreement b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_write_timestamp_disagreement index f86f42ab6610..5702f19730ac 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_write_timestamp_disagreement +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_committed_put_with_write_timestamp_disagreement @@ -8,4 +8,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000002"/0.000000002,0 @ s2 v2 -committed txn non-atomic timestamps: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [w]/Table/100/"0000000000000002":0.000000002,0->v2@s2 +committed serializable txn non-atomic timestamps: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [w]/Table/100/"0000000000000002":0.000000002,0->v2@s2 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_rolled_back_delete_with_write_incorrectly_present b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_rolled_back_delete_with_write_incorrectly_present index 9df69e998287..b6b4ad20bc4e 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_rolled_back_delete_with_write_incorrectly_present +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_rolled_back_delete_with_write_incorrectly_present @@ -6,4 +6,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return errors.New("rollback") }) // rollback /Table/100/"0000000000000001"/0.000000001,0 @ s1 -uncommitted txn had writes: [d]/Table/100/"0000000000000001":0.000000001,0->@s1 +uncommitted serializable txn had writes: [d]/Table/100/"0000000000000001":0.000000001,0->@s1 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_rolled_back_put_with_write_incorrectly_present b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_rolled_back_put_with_write_incorrectly_present index 2975958b3ee4..9b5742eb50f1 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_rolled_back_put_with_write_incorrectly_present +++ b/pkg/kv/kvnemesis/testdata/TestValidate/one_transactionally_rolled_back_put_with_write_incorrectly_present @@ -6,4 +6,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return errors.New("rollback") }) // rollback /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 -uncommitted txn had writes: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 +uncommitted serializable txn had writes: [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_after_delete b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_after_delete index add938495fbb..fe5588e5a13a 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_after_delete +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_after_delete @@ -10,4 +10,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { }) // @0.000000002,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s2 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0.000000001,0, )->v1 [d]/Table/100/"0000000000000001":0.000000002,0->@s2 [r]/Table/100/"0000000000000001":[0.000000001,0, 0.000000002,0)->v1 +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0.000000001,0, )->v1 [d]/Table/100/"0000000000000001":0.000000002,0->@s2 [r]/Table/100/"0000000000000001":[0.000000001,0, 0.000000002,0)->v1 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_after_write b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_after_write index 4987cb304be6..8537406fd3e5 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_after_write +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_after_write @@ -8,4 +8,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, )-> [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [r]/Table/100/"0000000000000001":[, 0.000000001,0)-> +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, )-> [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [r]/Table/100/"0000000000000001":[, 0.000000001,0)-> diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_before_delete b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_before_delete index 902af0d11267..da370b0e5007 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_before_delete +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_before_delete @@ -10,4 +10,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { }) // @0.000000002,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s2 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, 0.000000001,0)-> [d]/Table/100/"0000000000000001":0.000000002,0->@s2 [r]/Table/100/"0000000000000001":[, 0.000000001,0),[0.000000002,0, )-> +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, 0.000000001,0)-> [d]/Table/100/"0000000000000001":0.000000002,0->@s2 [r]/Table/100/"0000000000000001":[, 0.000000001,0),[0.000000002,0, )-> diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_before_write b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_before_write index 0019c9255a0d..fd19c96e4355 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_before_write +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_read_before_write @@ -8,4 +8,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0,0, 0,0)->v1 [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [r]/Table/100/"0000000000000001":[0.000000001,0, )->v1 +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0,0, 0,0)->v1 [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [r]/Table/100/"0000000000000001":[0.000000001,0, )->v1 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_scan_after_write b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_scan_after_write index 70f424f13cc3..a99244b778aa 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_scan_after_write +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_scan_after_write @@ -8,4 +8,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 -committed txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{gap:[, )}->[] [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0)}->[] +committed serializable txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{gap:[, )}->[] [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [s]/Table/100/"000000000000000{1"-3"}:{gap:[, 0.000000001,0)}->[] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_scan_before_write b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_scan_before_write index 51bcc08aebf5..b4d86a808c64 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_scan_before_write +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transaction_with_incorrect_scan_before_write @@ -8,4 +8,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 -committed txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0,0, 0,0), gap:[, )}->[/Table/100/"0000000000000001":v1] [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, ), gap:[, )}->[/Table/100/"0000000000000001":v1] +committed serializable txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0,0, 0,0), gap:[, )}->[/Table/100/"0000000000000001":v1] [w]/Table/100/"0000000000000001":0.000000001,0->v1@s1 [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, ), gap:[, )}->[/Table/100/"0000000000000001":v1] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_read_and_write_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_read_and_write_with_empty_time_overlap index 129f1e10012e..c3f64df0bbbd 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_read_and_write_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_read_and_write_with_empty_time_overlap @@ -11,4 +11,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000002"/0.000000002,0 @ s3 v3 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0.000000001,0, 0.000000002,0)->v1 [w]/Table/100/"0000000000000002":0.000000002,0->v3@s3 +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0.000000001,0, 0.000000002,0)->v1 [w]/Table/100/"0000000000000002":0.000000002,0->v3@s3 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_after_writes_and_deletes_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_after_writes_and_deletes_with_empty_time_overlap index 1a97e249fcd4..f45eaa9c2519 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_after_writes_and_deletes_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_after_writes_and_deletes_with_empty_time_overlap @@ -19,4 +19,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000002"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000001"/0.000000003,0 @ s3 /Table/100/"0000000000000002"/0.000000003,0 @ s4 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, 0.000000001,0),[0.000000003,0, )-> [r]/Table/100/"0000000000000002":[0.000000002,0, 0.000000003,0)->v2 [r]/Table/100/"0000000000000003":[, )-> +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, 0.000000001,0),[0.000000003,0, )-> [r]/Table/100/"0000000000000002":[0.000000002,0, 0.000000003,0)->v2 [r]/Table/100/"0000000000000003":[, )-> diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_and_deletes_after_write_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_and_deletes_after_write_with_empty_time_overlap index d17d3a845efe..1580e95dfd98 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_and_deletes_after_write_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_and_deletes_after_write_with_empty_time_overlap @@ -14,4 +14,4 @@ db0.Del(ctx, tk(1) /* @s4 */) // @0.000000004,0 /Table/100/"0000000000000001"/0.000000002,0 @ s2 /Table/100/"0000000000000001"/0.000000003,0 @ s3 v3 /Table/100/"0000000000000001"/0.000000004,0 @ s4 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, 0.000000001,0),[0.000000004,0, )-> [d]/Table/100/"0000000000000001":0.000000002,0->@s2 [r]/Table/100/"0000000000000001":[, 0.000000001,0),[0.000000004,0, ),[0.000000002,0, 0.000000003,0)-> +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, 0.000000001,0),[0.000000004,0, )-> [d]/Table/100/"0000000000000001":0.000000002,0->@s2 [r]/Table/100/"0000000000000001":[, 0.000000001,0),[0.000000004,0, ),[0.000000002,0, 0.000000003,0)-> diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_one_missing_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_one_missing_with_empty_time_overlap index 2d0d60f18074..bad37edf5f1e 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_one_missing_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_one_missing_with_empty_time_overlap @@ -12,4 +12,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000002"/0.000000001,0 @ s3 v3 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0.000000001,0, 0.000000002,0)->v1 [r]/Table/100/"0000000000000002":[, 0.000000001,0)-> +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0.000000001,0, 0.000000002,0)->v1 [r]/Table/100/"0000000000000002":[, 0.000000001,0)-> diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_with_empty_time_overlap index 0b51610a1d03..57d26a0a4916 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_reads_with_empty_time_overlap @@ -14,4 +14,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000002"/0.000000002,0 @ s3 v3 /Table/100/"0000000000000002"/0.000000003,0 @ s4 v4 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0.000000001,0, 0.000000002,0)->v1 [r]/Table/100/"0000000000000002":[0.000000002,0, 0.000000003,0)->v3 +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[0.000000001,0, 0.000000002,0)->v1 [r]/Table/100/"0000000000000002":[0.000000002,0, 0.000000003,0)->v3 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scan_and_write_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scan_and_write_with_empty_time_overlap index 4467ec48255e..499bbc727852 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scan_and_write_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scan_and_write_with_empty_time_overlap @@ -11,4 +11,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000002"/0.000000002,0 @ s3 v3 -committed txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, 0.000000002,0), gap:[, )}->[/Table/100/"0000000000000001":v1] [w]/Table/100/"0000000000000002":0.000000002,0->v3@s3 +committed serializable txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, 0.000000002,0), gap:[, )}->[/Table/100/"0000000000000001":v1] [w]/Table/100/"0000000000000002":0.000000002,0->v3@s3 diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_after_delete_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_after_delete_with_empty_time_overlap index d0cf575c2fcf..3da81f084f42 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_after_delete_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_after_delete_with_empty_time_overlap @@ -14,4 +14,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000002"/0.000000001,0 @ s3 v3 /Table/100/"0000000000000002"/0.000000003,0 @ s4 -committed txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, 0.000000002,0), gap:[, 0.000000001,0),[0.000000003,0, )}->[/Table/100/"0000000000000001":v1] [s]/Table/100/"000000000000000{2"-4"}:{gap:[, 0.000000001,0),[0.000000003,0, )}->[] +committed serializable txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, 0.000000002,0), gap:[, 0.000000001,0),[0.000000003,0, )}->[/Table/100/"0000000000000001":v1] [s]/Table/100/"000000000000000{2"-4"}:{gap:[, 0.000000001,0),[0.000000003,0, )}->[] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_one_missing_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_one_missing_with_empty_time_overlap index 86eeb64a7579..718852ee1fc4 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_one_missing_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_one_missing_with_empty_time_overlap @@ -12,4 +12,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000001,0 @ s1 v1 /Table/100/"0000000000000001"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000002"/0.000000001,0 @ s3 v3 -committed txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, 0.000000002,0), gap:[, 0.000000001,0)}->[/Table/100/"0000000000000001":v1] [s]/Table/100/"000000000000000{2"-4"}:{gap:[, 0.000000001,0)}->[] +committed serializable txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, 0.000000002,0), gap:[, 0.000000001,0)}->[/Table/100/"0000000000000001":v1] [s]/Table/100/"000000000000000{2"-4"}:{gap:[, 0.000000001,0)}->[] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_with_empty_time_overlap b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_with_empty_time_overlap index 2585d96cad97..3748d711af99 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_with_empty_time_overlap +++ b/pkg/kv/kvnemesis/testdata/TestValidate/transactional_scans_with_empty_time_overlap @@ -14,4 +14,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { /Table/100/"0000000000000001"/0.000000002,0 @ s2 v2 /Table/100/"0000000000000002"/0.000000002,0 @ s3 v3 /Table/100/"0000000000000002"/0.000000003,0 @ s4 v4 -committed txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, 0.000000002,0), 1:[0.000000002,0, 0.000000003,0), gap:[, )}->[/Table/100/"0000000000000001":v1, /Table/100/"0000000000000002":v3] [s]/Table/100/"000000000000000{2"-4"}:{0:[0.000000002,0, 0.000000003,0), gap:[, )}->[/Table/100/"0000000000000002":v3] +committed serializable txn non-atomic timestamps: [s]/Table/100/"000000000000000{1"-3"}:{0:[0.000000001,0, 0.000000002,0), 1:[0.000000002,0, 0.000000003,0), gap:[, )}->[/Table/100/"0000000000000001":v1, /Table/100/"0000000000000002":v3] [s]/Table/100/"000000000000000{2"-4"}:{0:[0.000000002,0, 0.000000003,0), gap:[, )}->[/Table/100/"0000000000000002":v3] diff --git a/pkg/kv/kvnemesis/testdata/TestValidate/two_transactionally_committed_put_delete_ops_of_the_same_key_with_incorrect_read b/pkg/kv/kvnemesis/testdata/TestValidate/two_transactionally_committed_put_delete_ops_of_the_same_key_with_incorrect_read index 98f6aa3d87bc..1582aacdc473 100644 --- a/pkg/kv/kvnemesis/testdata/TestValidate/two_transactionally_committed_put_delete_ops_of_the_same_key_with_incorrect_read +++ b/pkg/kv/kvnemesis/testdata/TestValidate/two_transactionally_committed_put_delete_ops_of_the_same_key_with_incorrect_read @@ -10,4 +10,4 @@ db0.Txn(ctx, func(ctx context.Context, txn *kv.Txn) error { return nil }) // @0.000000001,0 /Table/100/"0000000000000001"/0.000000001,0 @ s2 -committed txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, )-> [w]/Table/100/"0000000000000001":missing->v1@s1 [r]/Table/100/"0000000000000001":[0.000000001,0, )->v1 [d]/Table/100/"0000000000000001":0.000000001,0->@s2 [r]/Table/100/"0000000000000001":[0,0, 0,0)->v1 +committed serializable txn non-atomic timestamps: [r]/Table/100/"0000000000000001":[, )-> [w]/Table/100/"0000000000000001":missing->v1@s1 [r]/Table/100/"0000000000000001":[0.000000001,0, )->v1 [d]/Table/100/"0000000000000001":0.000000001,0->@s2 [r]/Table/100/"0000000000000001":[0,0, 0,0)->v1 diff --git a/pkg/kv/kvnemesis/validator.go b/pkg/kv/kvnemesis/validator.go index 85230ba15e22..fd490148615e 100644 --- a/pkg/kv/kvnemesis/validator.go +++ b/pkg/kv/kvnemesis/validator.go @@ -712,9 +712,8 @@ func (v *validator) processOp(op Operation) { v.processOp(op) } prevFailures := v.failures - // TODO(nvanbenschoten): add isolation level to the atomicType string: - // atomicTxnType := fmt.Sprintf(`%s txn`, strings.ToLower(t.IsoLevel.String())) - v.checkAtomic(`txn`, t.Result) + atomicTxnType := fmt.Sprintf(`%s txn`, t.IsoLevel.StringLower()) + v.checkAtomic(atomicTxnType, t.Result) if t.IsoLevel == isolation.Snapshot { // TODO(nvanbenschoten): for now, we run snapshot transactions in the mix // but don't validate their results. Doing so is non-trivial. See #100169. diff --git a/pkg/kv/kvserver/concurrency/isolation/BUILD.bazel b/pkg/kv/kvserver/concurrency/isolation/BUILD.bazel index 24b0874b00c6..0252b2dcdf54 100644 --- a/pkg/kv/kvserver/concurrency/isolation/BUILD.bazel +++ b/pkg/kv/kvserver/concurrency/isolation/BUILD.bazel @@ -26,6 +26,7 @@ go_library( embed = [":isolation_go_proto"], importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/isolation", visibility = ["//visibility:public"], + deps = ["@com_github_gogo_protobuf//proto"], ) go_test( diff --git a/pkg/kv/kvserver/concurrency/isolation/levels.go b/pkg/kv/kvserver/concurrency/isolation/levels.go index fcf303a34f79..b570a93fbea3 100644 --- a/pkg/kv/kvserver/concurrency/isolation/levels.go +++ b/pkg/kv/kvserver/concurrency/isolation/levels.go @@ -12,6 +12,8 @@ // concepts used by concurrency control in the key-value layer. package isolation +import "github.com/gogo/protobuf/proto" + // WeakerThan returns true if the receiver's strength is weaker than the // parameter's strength. It returns false if the two isolation levels are // equivalent or if the parameter's strength is weaker than the receiver's. @@ -44,6 +46,23 @@ func (l Level) PerStatementReadSnapshot() bool { return l == ReadCommitted } +var levelNameLower = map[int32]string{ + int32(Serializable): "serializable", + int32(Snapshot): "snapshot", + int32(ReadCommitted): "read committed", +} + +func init() { + if len(levelNameLower) != len(Level_name) { + panic("missing lower-case name for isolation level") + } +} + +// StringLower returns the lower-case name of the isolation level. +func (l Level) StringLower() string { + return proto.EnumName(levelNameLower, int32(l)) +} + // SafeValue implements the redact.SafeValue interface. func (Level) SafeValue() {} diff --git a/pkg/kv/kvserver/concurrency/isolation/levels_test.go b/pkg/kv/kvserver/concurrency/isolation/levels_test.go index 686d37b6206b..f18c9ec457dc 100644 --- a/pkg/kv/kvserver/concurrency/isolation/levels_test.go +++ b/pkg/kv/kvserver/concurrency/isolation/levels_test.go @@ -64,3 +64,29 @@ func TestLevel_PerStatementReadSnapshot(t *testing.T) { }) } } + +func TestLevel_String(t *testing.T) { + exp := map[Level]string{ + Serializable: "Serializable", + Snapshot: "Snapshot", + ReadCommitted: "ReadCommitted", + } + for l, exp := range exp { + t.Run(l.String(), func(t *testing.T) { + require.Equal(t, exp, l.String()) + }) + } +} + +func TestLevel_StringLower(t *testing.T) { + exp := map[Level]string{ + Serializable: "serializable", + Snapshot: "snapshot", + ReadCommitted: "read committed", + } + for l, exp := range exp { + t.Run(l.String(), func(t *testing.T) { + require.Equal(t, exp, l.StringLower()) + }) + } +}