github.com/cockroachdb/pebble@v1.1.2/testdata/compaction_setup_inputs (about)

     1  setup-inputs a a
     2  L0
     3    a.SET.1-b.SET.2
     4  ----
     5  L0
     6    000001:[a#1,1-b#2,1]
     7  
     8  setup-inputs c c
     9  L0
    10    a.SET.1-b.SET.2
    11  ----
    12  
    13  # Verify we expand the start level inputs to a clean cut.
    14  setup-inputs a a
    15  L1
    16    a.SET.1-b.SET.2
    17    b.SET.1-c.SET.2
    18  ----
    19  L1
    20    000001:[a#1,1-b#2,1]
    21    000002:[b#1,1-c#2,1]
    22  
    23  # The range deletion sentinel acts as a clean cut boundary.
    24  setup-inputs a a
    25  L1
    26    a.SET.1-b.RANGEDEL.72057594037927935
    27    b.SET.1-c.SET.2
    28  ----
    29  L1
    30    000001:[a#1,1-b#72057594037927935,15]
    31  
    32  # Verify we expand the output level inputs to a clean cut.
    33  setup-inputs a a
    34  L1
    35    a.SET.5-b.SET.6
    36  L2
    37    a.SET.3-c.SET.4
    38    c.SET.3-d.SET.2
    39  ----
    40  L1
    41    000001:[a#5,1-b#6,1]
    42  L2
    43    000002:[a#3,1-c#4,1]
    44    000003:[c#3,1-d#2,1]
    45  
    46  # Verify we expand the output level inputs to a clean cut.
    47  setup-inputs a a
    48  L1
    49    a.SET.5-b.SET.6
    50  L2
    51    a.SET.3-c.RANGEDEL.72057594037927935
    52    c.SET.3-d.SET.2
    53  ----
    54  L1
    55    000001:[a#5,1-b#6,1]
    56  L2
    57    000002:[a#3,1-c#72057594037927935,15]
    58  
    59  # Verify we grow the start level inputs to include all sstables which
    60  # lie within the output level bounds.
    61  setup-inputs a a
    62  L1
    63    a.SET.5-b.SET.6
    64    c.SET.4-e.SET.3
    65  L2
    66    a.SET.3-d.SET.4
    67  ----
    68  L1
    69    000001:[a#5,1-b#6,1]
    70    000002:[c#4,1-e#3,1]
    71  L2
    72    000003:[a#3,1-d#4,1]
    73  
    74  # Verify we limit the start level input expansion according to available
    75  # disk capacity.
    76  setup-inputs avail-bytes=10 a a
    77  L1
    78    a.SET.5-b.SET.6 size=2
    79    c.SET.4-e.SET.3 size=1
    80  L2
    81    a.SET.3-d.SET.4 size=3
    82  ----
    83  L1
    84    000001:[a#5,1-b#6,1]
    85  L2
    86    000003:[a#3,1-d#4,1]
    87  
    88  # Verify the available disk capacity limit doesn't affect the
    89  # output level clean-cut expansion.
    90  setup-inputs avail-bytes=10 a a
    91  L1
    92    a.SET.5-b.SET.6 size=5
    93    c.SET.4-e.SET.3 size=10
    94  L2
    95    a.SET.3-d.SET.4 size=5
    96    d.SET.2-e.SET.2 size=5
    97  ----
    98  L1
    99    000001:[a#5,1-b#6,1]
   100  L2
   101    000003:[a#3,1-d#4,1]
   102    000004:[d#2,1-e#2,1]
   103  
   104  # We won't grow the start level inputs if doing so would grow the
   105  # output level inputs.
   106  setup-inputs a a
   107  L1
   108    a.SET.5-b.SET.6
   109    c.SET.4-e.SET.3
   110  L2
   111    a.SET.3-d.SET.4
   112    e.SET.2-f.SET.1
   113  ----
   114  L1
   115    000001:[a#5,1-b#6,1]
   116  L2
   117    000003:[a#3,1-d#4,1]
   118  
   119  # Verify setup inputs can identify compacting files in range
   120  setup-inputs a a
   121  L1
   122    a.SET.5-b.SET.6
   123  L2
   124    a.SET.3-c.SET.4
   125    c.SET.3-d.SET.2 compacting
   126    d.SET.3-e.SET.6
   127  ----
   128  L1
   129    000001:[a#5,1-b#6,1]
   130  L2
   131    000002:[a#3,1-c#4,1]
   132    000003:[c#3,1-d#2,1]
   133    000004:[d#3,1-e#6,1]
   134  is-compacting
   135  
   136  # Verify when there is one file in range and it is compacting
   137  setup-inputs a a
   138  L2
   139    a.SET.3-c.SET.4 compacting
   140    d.SET.3-e.SET.2
   141  ----
   142  L2
   143    000001:[a#3,1-c#4,1]
   144  is-compacting
   145  
   146  # Verify when there is one file in level and is compacting
   147  setup-inputs a a
   148  L2
   149    a.SET.3-c.SET.4 compacting
   150  ----
   151  L2
   152    000001:[a#3,1-c#4,1]
   153  is-compacting