github.com/zuoyebang/bitalostable@v1.0.1-0.20240229032404-e3b99a834294/testdata/ingest (about)

     1  ingest
     2  ----
     3  
     4  ingest non-existent
     5  ----
     6  stat non-existent: file does not exist
     7  
     8  # Elide ingestion of empty sstables.
     9  
    10  build ext0
    11  ----
    12  
    13  ingest ext0
    14  ----
    15  
    16  lsm
    17  ----
    18  
    19  build ext0
    20  set a 1
    21  set b 2
    22  ----
    23  
    24  ingest ext0
    25  ----
    26  
    27  lsm
    28  ----
    29  6:
    30    000006:[a#1,SET-b#1,SET]
    31  
    32  metrics
    33  ----
    34  __level_____count____size___score______in__ingest(sz_cnt)____move(sz_cnt)___write(sz_cnt)____read___r-amp___w-amp
    35      WAL         1     0 B       -     0 B       -       -       -       -     0 B       -       -       -     0.0
    36        0         0     0 B    0.00     0 B     0 B       0     0 B       0     0 B       0     0 B       0     0.0
    37        1         0     0 B    0.00     0 B     0 B       0     0 B       0     0 B       0     0 B       0     0.0
    38        2         0     0 B    0.00     0 B     0 B       0     0 B       0     0 B       0     0 B       0     0.0
    39        3         0     0 B    0.00     0 B     0 B       0     0 B       0     0 B       0     0 B       0     0.0
    40        4         0     0 B    0.00     0 B     0 B       0     0 B       0     0 B       0     0 B       0     0.0
    41        5         0     0 B    0.00     0 B     0 B       0     0 B       0     0 B       0     0 B       0     0.0
    42        6         1   833 B       -     0 B   833 B       1     0 B       0     0 B       0     0 B       1     0.0
    43    total         1   833 B       -   833 B   833 B       1     0 B       0   833 B       0     0 B       1     1.0
    44    flush         0
    45  compact         0     0 B     0 B       0          (size == estimated-debt, score = in-progress-bytes, in = num-in-progress)
    46    ctype         0       0       0       0       0       0       0  (default, delete, elision, move, read, rewrite, multi-level)
    47   memtbl         1   256 K
    48  zmemtbl         0     0 B
    49     ztbl         0     0 B
    50   bcache         8   1.5 K   42.9%  (score == hit-rate)
    51   tcache         1   680 B   50.0%  (score == hit-rate)
    52    snaps         0       -       0  (score == earliest seq num)
    53   titers         0
    54   filter         -       -    0.0%  (score == utility)
    55  
    56  iter
    57  seek-ge a
    58  next
    59  next
    60  ----
    61  a:1
    62  b:2
    63  .
    64  
    65  get
    66  a
    67  b
    68  ----
    69  a:1
    70  b:2
    71  
    72  wait-pending-table-stats
    73  000006
    74  ----
    75  num-entries: 2
    76  num-deletions: 0
    77  num-range-key-sets: 0
    78  point-deletions-bytes-estimate: 0
    79  range-deletions-bytes-estimate: 0
    80  
    81  build ext1
    82  set a 3
    83  del b
    84  ----
    85  
    86  ingest ext1
    87  ----
    88  
    89  lsm
    90  ----
    91  0.0:
    92    000007:[a#2,SET-b#2,DEL]
    93  6:
    94    000006:[a#1,SET-b#1,SET]
    95  
    96  iter
    97  seek-ge a
    98  next
    99  ----
   100  a:3
   101  .
   102  
   103  get
   104  a
   105  b
   106  ----
   107  a:3
   108  b: bitable: not found
   109  
   110  build ext2
   111  set a 4
   112  set b 5
   113  set c 6
   114  ----
   115  
   116  ingest ext2
   117  ----
   118  
   119  lsm
   120  ----
   121  0.1:
   122    000008:[a#3,SET-c#3,SET]
   123  0.0:
   124    000007:[a#2,SET-b#2,DEL]
   125  6:
   126    000006:[a#1,SET-b#1,SET]
   127  
   128  iter
   129  seek-ge a
   130  next
   131  next
   132  ----
   133  a:4
   134  b:5
   135  c:6
   136  
   137  get
   138  a
   139  b
   140  c
   141  ----
   142  a:4
   143  b:5
   144  c:6
   145  
   146  build ext3
   147  merge b 5
   148  del c
   149  ----
   150  
   151  ingest ext3
   152  ----
   153  
   154  lsm
   155  ----
   156  0.2:
   157    000009:[b#4,MERGE-c#4,DEL]
   158  0.1:
   159    000008:[a#3,SET-c#3,SET]
   160  0.0:
   161    000007:[a#2,SET-b#2,DEL]
   162  6:
   163    000006:[a#1,SET-b#1,SET]
   164  
   165  iter
   166  seek-ge a
   167  next
   168  next
   169  ----
   170  a:4
   171  b:55
   172  .
   173  
   174  get
   175  a
   176  b
   177  c
   178  ----
   179  a:4
   180  b:55
   181  c: bitable: not found
   182  
   183  build ext4
   184  set x 7
   185  set y 8
   186  ----
   187  
   188  ingest ext4
   189  ----
   190  
   191  lsm
   192  ----
   193  0.2:
   194    000009:[b#4,MERGE-c#4,DEL]
   195  0.1:
   196    000008:[a#3,SET-c#3,SET]
   197  0.0:
   198    000007:[a#2,SET-b#2,DEL]
   199  6:
   200    000006:[a#1,SET-b#1,SET]
   201    000010:[x#5,SET-y#5,SET]
   202  
   203  iter
   204  seek-lt y
   205  prev
   206  prev
   207  ----
   208  x:7
   209  b:55
   210  a:4
   211  
   212  get
   213  x
   214  y
   215  ----
   216  x:7
   217  y:8
   218  
   219  batch
   220  set j 9
   221  set k 10
   222  ----
   223  
   224  # Overlap with point keys in memtable, hence memtable will be flushed.
   225  
   226  build ext5
   227  set k 11
   228  ----
   229  
   230  ingest ext5
   231  ----
   232  memtable flushed
   233  
   234  lsm
   235  ----
   236  0.2:
   237    000009:[b#4,MERGE-c#4,DEL]
   238  0.1:
   239    000008:[a#3,SET-c#3,SET]
   240    000011:[k#8,SET-k#8,SET]
   241  0.0:
   242    000007:[a#2,SET-b#2,DEL]
   243    000013:[j#6,SET-k#7,SET]
   244  6:
   245    000006:[a#1,SET-b#1,SET]
   246    000010:[x#5,SET-y#5,SET]
   247  
   248  iter
   249  seek-ge j
   250  next
   251  ----
   252  j:9
   253  k:11
   254  
   255  get
   256  j
   257  k
   258  ----
   259  j:9
   260  k:11
   261  
   262  # No data overlap in memtable, hence it will not be flushed.
   263  
   264  batch
   265  set m 12
   266  ----
   267  
   268  build ext6
   269  set n 13
   270  ----
   271  
   272  ingest ext6
   273  ----
   274  
   275  lsm
   276  ----
   277  0.2:
   278    000009:[b#4,MERGE-c#4,DEL]
   279  0.1:
   280    000008:[a#3,SET-c#3,SET]
   281    000011:[k#8,SET-k#8,SET]
   282  0.0:
   283    000007:[a#2,SET-b#2,DEL]
   284    000013:[j#6,SET-k#7,SET]
   285  6:
   286    000006:[a#1,SET-b#1,SET]
   287    000014:[n#10,SET-n#10,SET]
   288    000010:[x#5,SET-y#5,SET]
   289  
   290  get
   291  m
   292  n
   293  ----
   294  m:12
   295  n:13
   296  
   297  build ext7
   298  del-range a c
   299  del-range x z
   300  ----
   301  
   302  ingest ext7
   303  ----
   304  memtable flushed
   305  
   306  lsm
   307  ----
   308  0.3:
   309    000015:[a#11,RANGEDEL-z#72057594037927935,RANGEDEL]
   310  0.2:
   311    000009:[b#4,MERGE-c#4,DEL]
   312  0.1:
   313    000008:[a#3,SET-c#3,SET]
   314    000011:[k#8,SET-k#8,SET]
   315  0.0:
   316    000007:[a#2,SET-b#2,DEL]
   317    000013:[j#6,SET-k#7,SET]
   318    000017:[m#9,SET-m#9,SET]
   319  6:
   320    000006:[a#1,SET-b#1,SET]
   321    000014:[n#10,SET-n#10,SET]
   322    000010:[x#5,SET-y#5,SET]
   323  
   324  get
   325  a
   326  b
   327  c
   328  j
   329  k
   330  m
   331  n
   332  x
   333  y
   334  ----
   335  a: bitable: not found
   336  b: bitable: not found
   337  c: bitable: not found
   338  j:9
   339  k:11
   340  m:12
   341  n:13
   342  x: bitable: not found
   343  y: bitable: not found
   344  
   345  wait-pending-table-stats
   346  000015
   347  ----
   348  num-entries: 2
   349  num-deletions: 2
   350  num-range-key-sets: 0
   351  point-deletions-bytes-estimate: 0
   352  range-deletions-bytes-estimate: 1666
   353  
   354  # A set operation takes precedence over a range deletion at the same
   355  # sequence number as can occur during ingestion.
   356  
   357  build ext8
   358  set j 20
   359  del-range j k
   360  set m 30
   361  ----
   362  
   363  ingest ext8
   364  ----
   365  
   366  get
   367  j
   368  k
   369  m
   370  ----
   371  j:20
   372  k:11
   373  m:30
   374  
   375  build ext9
   376  set a 40
   377  set f 40
   378  set g 40
   379  ----
   380  
   381  ingest ext9
   382  ----
   383  
   384  lsm
   385  ----
   386  0.4:
   387    000019:[a#13,SET-g#13,SET]
   388    000018:[j#12,RANGEDEL-m#12,SET]
   389  0.3:
   390    000015:[a#11,RANGEDEL-z#72057594037927935,RANGEDEL]
   391  0.2:
   392    000009:[b#4,MERGE-c#4,DEL]
   393  0.1:
   394    000008:[a#3,SET-c#3,SET]
   395    000011:[k#8,SET-k#8,SET]
   396  0.0:
   397    000007:[a#2,SET-b#2,DEL]
   398    000013:[j#6,SET-k#7,SET]
   399    000017:[m#9,SET-m#9,SET]
   400  6:
   401    000006:[a#1,SET-b#1,SET]
   402    000014:[n#10,SET-n#10,SET]
   403    000010:[x#5,SET-y#5,SET]
   404  
   405  # Overlap with sst boundary containing range del sentinel (fileNum 000015) is not considered an overlap since
   406  # range del's end key is exclusive. Hence ext9 gets ingested into L6.
   407  
   408  build ext10
   409  set z 40
   410  ----
   411  
   412  # Although ext11 falls into sst boundaries of fileNum 000019, 000015, they don't actually contain any key within ext11's boundary.
   413  # Hence ext11 is allowed to go further down and get ingested into L6.
   414  
   415  build ext11
   416  set d 40
   417  ----
   418  
   419  # Overlap with fileNum 000018 is not considered an overlap since ext12's end key is range del sentinel which is exclusive.
   420  
   421  build ext12
   422  del-range i j
   423  ----
   424  
   425  # Ingesting multiple files into L0 is allowed.
   426  
   427  ingest ext10 ext11 ext12
   428  ----
   429  
   430  get
   431  z
   432  d
   433  ----
   434  z:40
   435  d:40
   436  
   437  lsm
   438  ----
   439  0.4:
   440    000019:[a#13,SET-g#13,SET]
   441    000018:[j#12,RANGEDEL-m#12,SET]
   442  0.3:
   443    000015:[a#11,RANGEDEL-z#72057594037927935,RANGEDEL]
   444  0.2:
   445    000009:[b#4,MERGE-c#4,DEL]
   446  0.1:
   447    000008:[a#3,SET-c#3,SET]
   448    000011:[k#8,SET-k#8,SET]
   449  0.0:
   450    000007:[a#2,SET-b#2,DEL]
   451    000013:[j#6,SET-k#7,SET]
   452    000017:[m#9,SET-m#9,SET]
   453  6:
   454    000006:[a#1,SET-b#1,SET]
   455    000021:[d#14,SET-d#14,SET]
   456    000022:[i#15,RANGEDEL-j#72057594037927935,RANGEDEL]
   457    000014:[n#10,SET-n#10,SET]
   458    000010:[x#5,SET-y#5,SET]
   459    000020:[z#16,SET-z#16,SET]
   460  
   461  # No overlap between fileNum 000019 that contains point key f, since f is ingested file's range del sentinel.
   462  
   463  build ext13
   464  del-range e f
   465  ----
   466  
   467  ingest ext13
   468  ----
   469  
   470  lsm
   471  ----
   472  0.4:
   473    000019:[a#13,SET-g#13,SET]
   474    000018:[j#12,RANGEDEL-m#12,SET]
   475  0.3:
   476    000015:[a#11,RANGEDEL-z#72057594037927935,RANGEDEL]
   477  0.2:
   478    000009:[b#4,MERGE-c#4,DEL]
   479  0.1:
   480    000008:[a#3,SET-c#3,SET]
   481    000011:[k#8,SET-k#8,SET]
   482  0.0:
   483    000007:[a#2,SET-b#2,DEL]
   484    000013:[j#6,SET-k#7,SET]
   485    000017:[m#9,SET-m#9,SET]
   486  6:
   487    000006:[a#1,SET-b#1,SET]
   488    000021:[d#14,SET-d#14,SET]
   489    000023:[e#17,RANGEDEL-f#72057594037927935,RANGEDEL]
   490    000022:[i#15,RANGEDEL-j#72057594037927935,RANGEDEL]
   491    000014:[n#10,SET-n#10,SET]
   492    000010:[x#5,SET-y#5,SET]
   493    000020:[z#16,SET-z#16,SET]
   494  
   495  # Overlap with range delete keys in memtable, hence memtable will be flushed.
   496  
   497  batch
   498  del-range a d
   499  ----
   500  
   501  build ext14
   502  set b 1
   503  ----
   504  
   505  ingest ext14
   506  ----
   507  memtable flushed
   508  
   509  lsm
   510  ----
   511  0.6:
   512    000024:[b#19,SET-b#19,SET]
   513  0.5:
   514    000026:[a#18,RANGEDEL-d#72057594037927935,RANGEDEL]
   515  0.4:
   516    000019:[a#13,SET-g#13,SET]
   517    000018:[j#12,RANGEDEL-m#12,SET]
   518  0.3:
   519    000015:[a#11,RANGEDEL-z#72057594037927935,RANGEDEL]
   520  0.2:
   521    000009:[b#4,MERGE-c#4,DEL]
   522  0.1:
   523    000008:[a#3,SET-c#3,SET]
   524    000011:[k#8,SET-k#8,SET]
   525  0.0:
   526    000007:[a#2,SET-b#2,DEL]
   527    000013:[j#6,SET-k#7,SET]
   528    000017:[m#9,SET-m#9,SET]
   529  6:
   530    000006:[a#1,SET-b#1,SET]
   531    000021:[d#14,SET-d#14,SET]
   532    000023:[e#17,RANGEDEL-f#72057594037927935,RANGEDEL]
   533    000022:[i#15,RANGEDEL-j#72057594037927935,RANGEDEL]
   534    000014:[n#10,SET-n#10,SET]
   535    000010:[x#5,SET-y#5,SET]
   536    000020:[z#16,SET-z#16,SET]
   537  
   538  reset
   539  ----
   540  
   541  # Tests to show that keys don't overlap with range delete sentinels.
   542  
   543  batch
   544  set b 1
   545  ----
   546  
   547  build ext15
   548  del-range a b
   549  ----
   550  
   551  ingest ext15
   552  ----
   553  
   554  lsm
   555  ----
   556  6:
   557    000004:[a#2,RANGEDEL-b#72057594037927935,RANGEDEL]
   558  
   559  reset
   560  ----
   561  
   562  batch
   563  del-range b c
   564  ----
   565  
   566  build ext16
   567  del-range a b
   568  ----
   569  
   570  ingest ext16
   571  ----
   572  
   573  lsm
   574  ----
   575  6:
   576    000004:[a#2,RANGEDEL-b#72057594037927935,RANGEDEL]
   577  
   578  reset
   579  ----
   580  
   581  # Tests for branch coverage of method overlapWithIterator,
   582  # when levelIter is used and it produces a range del sentinel boundary
   583  # because it finds no overlapping point key.
   584  
   585  # Case 1) levelIter produced boundary is less than ingested file's largest key.
   586  
   587  build ext17
   588  del-range a b
   589  ----
   590  
   591  ingest ext17
   592  ----
   593  
   594  build ext18
   595  set a 10
   596  set c 10
   597  ----
   598  
   599  ingest ext18
   600  ----
   601  
   602  lsm
   603  ----
   604  0.0:
   605    000005:[a#2,SET-c#2,SET]
   606  6:
   607    000004:[a#1,RANGEDEL-b#72057594037927935,RANGEDEL]
   608  
   609  reset
   610  ----
   611  
   612  # Case 2) levelIter produced boundary is more than ingested file's largest key.
   613  
   614  build ext19
   615  del-range c d
   616  ----
   617  
   618  ingest ext19
   619  ----
   620  
   621  build ext20
   622  set a 10
   623  set b 10
   624  ----
   625  
   626  ingest ext20
   627  ----
   628  
   629  build ext21
   630  set c 10
   631  ----
   632  
   633  ingest ext21
   634  ----
   635  
   636  lsm
   637  ----
   638  0.0:
   639    000006:[c#3,SET-c#3,SET]
   640  6:
   641    000005:[a#2,SET-b#2,SET]
   642    000004:[c#1,RANGEDEL-d#72057594037927935,RANGEDEL]
   643  
   644  reset
   645  ----
   646  
   647  # Case 3) levelIter produced boundary is equal to ingested file's largest key,
   648  # where the latter is not a range del sentinel.
   649  
   650  build ext22
   651  del-range a b
   652  ----
   653  
   654  ingest ext22
   655  ----
   656  
   657  build ext23
   658  set a 10
   659  set b 10
   660  ----
   661  
   662  ingest ext23
   663  ----
   664  
   665  lsm
   666  ----
   667  0.0:
   668    000005:[a#2,SET-b#2,SET]
   669  6:
   670    000004:[a#1,RANGEDEL-b#72057594037927935,RANGEDEL]
   671  
   672  reset
   673  ----
   674  
   675  # Case 4) levelIter produced boundary is equal to ingested file's largest key,
   676  # where the latter is a range del sentinel.
   677  
   678  build ext24
   679  del-range a b
   680  ----
   681  
   682  ingest ext24
   683  ----
   684  
   685  build ext25
   686  del-range a b
   687  ----
   688  
   689  ingest ext25
   690  ----
   691  
   692  lsm
   693  ----
   694  0.0:
   695    000005:[a#2,RANGEDEL-b#72057594037927935,RANGEDEL]
   696  6:
   697    000004:[a#1,RANGEDEL-b#72057594037927935,RANGEDEL]