Skip to content

Commit

Permalink
manifest: use Lx for levels in version String/DebugString
Browse files Browse the repository at this point in the history
The version string shows levels as `1:` instead of `L1:` which is how
we usually display levels.

This change prepends the `L` and updates tests to expect it. This
makes it more clear what you are looking at and also makes the parsing
(`ParseVersionDebug`) less error-prone, as `1:` could also mean file
number 1.
  • Loading branch information
RaduBerinde committed Mar 11, 2024
1 parent 8df4320 commit 623524f
Show file tree
Hide file tree
Showing 56 changed files with 1,064 additions and 1,067 deletions.
4 changes: 2 additions & 2 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,13 @@ func TestLargeBatch(t *testing.T) {

// Verify this results in one L0 table being created.
require.NoError(t, try(100*time.Microsecond, 20*time.Second,
verifyLSM("0.0:\n 000005:[a#10,SET-a#10,SET]\n")))
verifyLSM("L0.0:\n 000005:[a#10,SET-a#10,SET]\n")))

require.NoError(t, d.Set([]byte("b"), bytes.Repeat([]byte("b"), 512), nil))

// Verify this results in a second L0 table being created.
require.NoError(t, try(100*time.Microsecond, 20*time.Second,
verifyLSM("0.0:\n 000005:[a#10,SET-a#10,SET]\n 000007:[b#11,SET-b#11,SET]\n")))
verifyLSM("L0.0:\n 000005:[a#10,SET-a#10,SET]\n 000007:[b#11,SET-b#11,SET]\n")))

// Allocate a bunch of batches to exhaust the batchPool. None of these
// batches should have a non-zero count.
Expand Down
8 changes: 4 additions & 4 deletions error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ func TestRequireReadError(t *testing.T) {
require.NoError(t, d.Set(key1, value, nil))
require.NoError(t, d.Flush())
expectLSM(`
0.0:
L0.0:
000007:[a1#13,SET-a2#inf,RANGEDEL]
6:
L6:
000005:[a1#10,SET-a2#11,SET]
`, d, t)

Expand Down Expand Up @@ -291,9 +291,9 @@ func TestCorruptReadError(t *testing.T) {
require.NoError(t, d.Set(key1, value, nil))
require.NoError(t, d.Flush())
expectLSM(`
0.0:
L0.0:
000007:[a1#13,SET-a2#inf,RANGEDEL]
6:
L6:
000005:[a1#10,SET-a2#11,SET]
`, d, t)

Expand Down
8 changes: 4 additions & 4 deletions ingest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2646,10 +2646,10 @@ func TestConcurrentIngestCompact(t *testing.T) {
ingest("c")

expectLSM(`
0.0:
L0.0:
000005:[a#11,SET-a#11,SET]
000007:[c#13,SET-c#13,SET]
6:
L6:
000004:[a#10,SET-a#10,SET]
000006:[c#12,SET-c#12,SET]
`)
Expand All @@ -2673,9 +2673,9 @@ func TestConcurrentIngestCompact(t *testing.T) {
compact("a", "z")

expectLSM(`
0.0:
L0.0:
000009:[b#14,SET-b#14,SET]
6:
L6:
000008:[a#0,SET-c#0,SET]
`)

Expand Down
50 changes: 25 additions & 25 deletions internal/manifest/testdata/overlaps
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define
0:
L0:
000700:[b#7008,SET-e#7009,SET]
000701:[c#7018,SET-f#7019,SET]
000702:[f#7028,SET-g#7029,SET]
Expand All @@ -8,27 +8,27 @@ define
000705:[p#7058,SET-p#7059,SET]
000706:[p#7068,SET-u#7069,SET]
000707:[r#7078,SET-s#7079,SET]
1:
L1:
000710:[a#7140,SET-d#inf,RANGEDEL]
000711:[d#7108,SET-g#7109,SET]
000712:[g#7118,SET-j#7119,SET]
000713:[n#7128,SET-p#7129,SET]
000714:[p#7148,SET-p#7149,SET]
000715:[p#7138,SET-u#7139,SET]
----
0.3:
L0.3:
000704:[n#7048,SET-p#7049,SET]
0.2:
L0.2:
000700:[b#7008,SET-e#7009,SET]
000705:[p#7058,SET-p#7059,SET]
0.1:
L0.1:
000701:[c#7018,SET-f#7019,SET]
000706:[p#7068,SET-u#7069,SET]
0.0:
L0.0:
000702:[f#7028,SET-g#7029,SET]
000707:[r#7078,SET-s#7079,SET]
000703:[x#7038,SET-y#7039,SET]
1:
L1:
000710:[a#7140,SET-d#inf,RANGEDEL]
000711:[d#7108,SET-g#7109,SET]
000712:[g#7118,SET-j#7119,SET]
Expand Down Expand Up @@ -441,16 +441,16 @@ overlaps level=2 start=a end=z exclusive-end=false
# 000003 with the f largest bound must be included.

define
0:
L0:
000001:[a#1,SET-d#2,SET]
000002:[c#3,SET-f#4,SET]
000003:[f#5,SET-f#5,SET]
----
0.2:
L0.2:
000001:[a#1,SET-d#2,SET]
0.1:
L0.1:
000002:[c#3,SET-f#4,SET]
0.0:
L0.0:
000003:[f#5,SET-f#5,SET]

overlaps level=0 start=a end=b exclusive-end=true
Expand All @@ -466,64 +466,64 @@ overlaps level=0 start=a end=b exclusive-end=true
# included for completeness.

define
0.4:
L0.4:
000987:[aiinjp@20#4667,SET-fcklu@5#inf,RANGEDEL]
000988:[fcklu@5#4668,MERGE-glpw@1#inf,RANGEDEL]
000989:[glpw@1#4662,RANGEDEL-mlgxnog@19#inf,RANGEDEL]
000990:[mlgxnog@19#4662,RANGEDEL-nwnmqtyvjt@5#inf,RANGEDEL]
000991:[nwnmqtyvjt@5#4662,RANGEDEL-wmkrrxp@6#inf,RANGEDEL]
0.3:
L0.3:
000978:[dygfdczcax@15#4609,DEL-vtocgpw@18#4609,DEL]
000992:[wmkrrxp@6#4657,MERGE-yyquzcd@21#4624,SET]
000993:[zslykqao@12#4636,SINGLEDEL-zzqwavxgrec@12#4627,DEL]
0.2:
L0.2:
000981:[fhcykuix@5#4601,MERGE-kiati@10#4595,MERGE]
000977:[mgksrvk@15#4598,DEL-mgksrvk@15#4598,DEL]
000982:[nirnrarzktp@12#4600,MERGE-zaowx@3#4602,SET]
000828:[zzqwavxgrec@12#4092,SINGLEDEL-zzqwavxgrec@12#4092,SINGLEDEL]
0.1:
L0.1:
000980:[dusu@10#4603,SET-duyeldgvnll@21#4605,SET]
000973:[ewqqtp@15#4591,RANGEDEL-zaygjmy@1#inf,RANGEDEL]
000605:[zzqwavxgrec@12#2894,SET-zzqwavxgrec@12#2894,SET]
0.0:
L0.0:
000910:[abddymplk@20#4370,MERGE-abddymplk@20#4370,MERGE]
000939:[abvukibeofb@13#4439,SET-abvukibeofb@13#4439,SET]
000975:[ajoqjxr@16#4578,MERGE-zjyqka@1#4544,DEL]
000983:[znnoar@20#4604,SINGLEDEL-znnoar@20#4604,SINGLEDEL]
000535:[zzqwavxgrec@12#2657,SINGLEDEL-zzqwavxgrec@12#2526,SET]
5:
L5:
000971:[acutc@6#4227,SET-zzhra@12#inf,RANGEDEL]
6:
L6:
000806:[gourk@18#0,SET-zzhra@2#0,SET]
----
0.4:
L0.4:
000987:[aiinjp@20#4667,SET-fcklu@5#inf,RANGEDEL]
000988:[fcklu@5#4668,MERGE-glpw@1#inf,RANGEDEL]
000989:[glpw@1#4662,RANGEDEL-mlgxnog@19#inf,RANGEDEL]
000990:[mlgxnog@19#4662,RANGEDEL-nwnmqtyvjt@5#inf,RANGEDEL]
000991:[nwnmqtyvjt@5#4662,RANGEDEL-wmkrrxp@6#inf,RANGEDEL]
0.3:
L0.3:
000978:[dygfdczcax@15#4609,DEL-vtocgpw@18#4609,DEL]
000992:[wmkrrxp@6#4657,MERGE-yyquzcd@21#4624,SET]
000993:[zslykqao@12#4636,SINGLEDEL-zzqwavxgrec@12#4627,DEL]
0.2:
L0.2:
000981:[fhcykuix@5#4601,MERGE-kiati@10#4595,MERGE]
000977:[mgksrvk@15#4598,DEL-mgksrvk@15#4598,DEL]
000982:[nirnrarzktp@12#4600,MERGE-zaowx@3#4602,SET]
000828:[zzqwavxgrec@12#4092,SINGLEDEL-zzqwavxgrec@12#4092,SINGLEDEL]
0.1:
L0.1:
000980:[dusu@10#4603,SET-duyeldgvnll@21#4605,SET]
000973:[ewqqtp@15#4591,RANGEDEL-zaygjmy@1#inf,RANGEDEL]
000605:[zzqwavxgrec@12#2894,SET-zzqwavxgrec@12#2894,SET]
0.0:
L0.0:
000910:[abddymplk@20#4370,MERGE-abddymplk@20#4370,MERGE]
000939:[abvukibeofb@13#4439,SET-abvukibeofb@13#4439,SET]
000975:[ajoqjxr@16#4578,MERGE-zjyqka@1#4544,DEL]
000983:[znnoar@20#4604,SINGLEDEL-znnoar@20#4604,SINGLEDEL]
000535:[zzqwavxgrec@12#2657,SINGLEDEL-zzqwavxgrec@12#2526,SET]
5:
L5:
000971:[acutc@6#4227,SET-zzhra@12#inf,RANGEDEL]
6:
L6:
000806:[gourk@18#0,SET-zzhra@2#0,SET]

overlaps level=0 start=heacptnep@12 end=kiicbzwtpe@16 exclusive-end=false
Expand Down
Loading

0 comments on commit 623524f

Please sign in to comment.