@@ -188,6 +188,65 @@ L0.0:
188188Blob files:
189189 000006: 51 physical bytes, 5 value bytes
190190
191+ # Construct an initial state with two overlapping files in L0, both with blob
192+ # references. Because these files overlap and are in separate sublevels, a
193+ # compaction that preserves blob references should sum their depths.
194+
195+ define value-separation=(true,1,5) l0-compaction-threshold=2
196+ L0 blob-depth=1
197+ a.SET.9:a
198+ d.SET.9:blob{fileNum=100001 value=d}
199+ L0 blob-depth=3
200+ a.SET.1:a
201+ b.SET.1:blob{fileNum=100002 value=bar}
202+ f.SET.1:blob{fileNum=100003 value=foo}
203+ k.SET.1:k
204+ z.SET.1:blob{fileNum=100004 value=zoo}
205+ ----
206+ L0.1:
207+ 000004:[a#9,SET-d#9,SET] seqnums:[9-9] points:[a#9,SET-d#9,SET] size:775 blobrefs:[(100001: 1); depth:1]
208+ L0.0:
209+ 000005:[a#1,SET-z#1,SET] seqnums:[1-1] points:[a#1,SET-z#1,SET] size:795 blobrefs:[(100002: 3), (100003: 3), (100004: 3); depth:3]
210+
211+ compact a-z
212+ ----
213+ L1:
214+ 000006:[a#0,SET-z#0,SET] seqnums:[0-0] points:[a#0,SET-z#0,SET] size:819 blobrefs:[(100002: 3), (100001: 1), (100003: 3), (100004: 3); depth:4]
215+ Blob files:
216+ 100001: 47 physical bytes, 1 value bytes
217+ 100002: 49 physical bytes, 3 value bytes
218+ 100003: 49 physical bytes, 3 value bytes
219+ 100004: 49 physical bytes, 3 value bytes
220+
221+ # Construct an initial state with two non-overlapping files in L0, both with
222+ # blob references. Because these files do NOT overlap and are in the same
223+ # sublevel, a compaction that preserves blob references should take the MAX of
224+ # their depths.
225+
226+ define value-separation=(true,1,5) l0-compaction-threshold=2
227+ L0 blob-depth=1
228+ a.SET.9:a
229+ d.SET.9:blob{fileNum=100001 value=d}
230+ L0 blob-depth=3
231+ e.SET.1:a
232+ f.SET.1:blob{fileNum=100002 value=bar}
233+ g.SET.1:blob{fileNum=100003 value=foo}
234+ k.SET.1:k
235+ z.SET.1:blob{fileNum=100004 value=zoo}
236+ ----
237+ L0.0:
238+ 000004:[a#9,SET-d#9,SET] seqnums:[9-9] points:[a#9,SET-d#9,SET] size:775 blobrefs:[(100001: 1); depth:1]
239+ 000005:[e#1,SET-z#1,SET] seqnums:[1-1] points:[e#1,SET-z#1,SET] size:795 blobrefs:[(100002: 3), (100003: 3), (100004: 3); depth:3]
240+
241+ compact a-z
242+ ----
243+ L1:
244+ 000006:[a#0,SET-z#0,SET] seqnums:[0-0] points:[a#0,SET-z#0,SET] size:813 blobrefs:[(100001: 1), (100002: 3), (100003: 3), (100004: 3); depth:3]
245+ Blob files:
246+ 100001: 47 physical bytes, 1 value bytes
247+ 100002: 49 physical bytes, 3 value bytes
248+ 100003: 49 physical bytes, 3 value bytes
249+ 100004: 49 physical bytes, 3 value bytes
191250
192251define value-separation=(true,5,5) l0-compaction-threshold=1
193252----
0 commit comments