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

     1  init 1
     2  ----
     3  
     4  init_cp
     5  ----
     6  base: 6
     7  
     8  queue
     9  ----
    10  
    11  init 1
    12  6: 1
    13  ----
    14  
    15  init_cp
    16  ----
    17  base: 6
    18  
    19  queue
    20  ----
    21  
    22  init 1
    23  6: 1000000
    24  ----
    25  
    26  init_cp
    27  ----
    28  base: 1
    29  
    30  queue
    31  ----
    32  
    33  init 1
    34  5: 1
    35  6: 10
    36  ----
    37  
    38  init_cp
    39  ----
    40  base: 5
    41  
    42  queue
    43  ----
    44  L5->L6: 1.0
    45  
    46  init 1
    47  5: 2
    48  6: 10
    49  ----
    50  
    51  init_cp
    52  ----
    53  base: 5
    54  
    55  queue
    56  ----
    57  L5->L6: 2.2
    58  
    59  # Smoothing multiplier is
    60  # `(size(Lbottom)/size(Lbase))^(Lbottom-Lbase) = (30/1)^(1/(6-4)) = 30^(1/2)`
    61  #
    62  # size(L4) = size(Lbase) = 1
    63  # size(L5) = size(L4) * 30^(1/2) ~= 5
    64  # size(L6) = size(L5) * 30^(1/2) = 30
    65  
    66  init 1
    67  5: 2
    68  6: 30
    69  ----
    70  
    71  init_cp
    72  ----
    73  base: 4
    74  
    75  queue
    76  ----
    77  
    78  init 1
    79  4: 2
    80  5: 2
    81  6: 100
    82  ----
    83  
    84  init_cp
    85  ----
    86  base: 4
    87  
    88  queue
    89  ----
    90  L4->L5: 10.0
    91  
    92  init 1
    93  4: 1
    94  5: 2
    95  6: 100
    96  ----
    97  
    98  init_cp
    99  ----
   100  base: 4
   101  
   102  queue
   103  ----
   104  L4->L5: 5.0
   105  
   106  init 1
   107  4: 1
   108  5: 11
   109  6: 100
   110  ----
   111  
   112  init_cp
   113  ----
   114  base: 4
   115  
   116  queue
   117  ----
   118  L5->L6: 1.1
   119  
   120  init 1
   121  4: 2
   122  5: 11
   123  6: 100
   124  ----
   125  
   126  init_cp
   127  ----
   128  base: 4
   129  
   130  queue
   131  ----
   132  L4->L5: 1.8
   133  
   134  init 1
   135  0: 4
   136  ----
   137  
   138  init_cp
   139  ----
   140  base: 6
   141  
   142  queue
   143  ----
   144  L0->L6: 200.0
   145  
   146  init 1
   147  0: 5
   148  ----
   149  
   150  init_cp
   151  ----
   152  base: 6
   153  
   154  queue
   155  ----
   156  L0->L6: 250.0
   157  
   158  init 1
   159  0: 5
   160  5: 2
   161  6: 10
   162  ----
   163  
   164  init_cp
   165  ----
   166  base: 5
   167  
   168  queue
   169  ----
   170  L5->L6: 3.2
   171  
   172  pick
   173  ----
   174  L5->L6: 3.2
   175  
   176  pick ongoing=(5,6)
   177  ----
   178  no compaction
   179  
   180  init 1
   181  0: 10
   182  4: 10
   183  5: 6
   184  6: 10
   185  ----
   186  
   187  init_cp
   188  ----
   189  base: 4
   190  
   191  queue
   192  ----
   193  L4->L5: 10.0
   194  L4->L5: 7.7
   195  
   196  pick ongoing=(5,6)
   197  ----
   198  no compaction
   199  
   200  pick ongoing=(0,4)
   201  ----
   202  L5->L6: 3.3
   203  
   204  pick ongoing=(0,0,0,4)
   205  ----
   206  no compaction
   207  
   208  init_cp
   209  ----
   210  base: 4
   211  
   212  pick ongoing=(0,5)
   213  ----
   214  no compaction
   215  
   216  init 1
   217  0: 20
   218  6: 10
   219  ----
   220  
   221  init_cp ongoing=(0,5)
   222  ----
   223  base: 4
   224  
   225  queue
   226  ----
   227  L0->L4: 1000.0
   228  
   229  pick
   230  ----
   231  L0->L4: 1000.0
   232  
   233  pick ongoing=(0,4)
   234  ----
   235  no compaction
   236  
   237  # We'll only pick a concurrent compaction if it is "high" priority
   238  # (i.e. has a score >= highPriorityThreshold).
   239  
   240  init 1
   241  0: 20
   242  5: 1
   243  6: 10
   244  ----
   245  
   246  init_cp ongoing=(0,4)
   247  ----
   248  base: 4
   249  
   250  queue
   251  ----
   252  L0->L4: 1000.0
   253  
   254  pick ongoing=(0,4,4,5)
   255  ----
   256  no compaction
   257  
   258  pick ongoing=(4,5)
   259  ----
   260  L0->L4: 1000.0
   261  
   262  # Verify we can start concurrent Ln->Ln+1 compactions given sufficient
   263  # priority.
   264  
   265  init 1
   266  5: 4
   267  6: 10
   268  ----
   269  
   270  init_cp
   271  ----
   272  base: 5
   273  
   274  queue
   275  ----
   276  L5->L6: 5.2
   277  
   278  pick
   279  ----
   280  L5->L6: 5.2
   281  
   282  pick ongoing=(5,6)
   283  ----
   284  no compaction
   285  
   286  # Verify that successive manual compactions interleaved with an automatic
   287  # compaction does not trigger an error.
   288  
   289  init 5
   290  0: 10
   291  5: 10
   292  6: 5
   293  ----
   294  
   295  init_cp
   296  ----
   297  base: 5
   298  
   299  queue
   300  ----
   301  L5->L6: 9.2
   302  L5->L6: 6.9
   303  
   304  pick_manual level=0 start=0 end=12
   305  ----
   306  L0->L5, retryLater = false
   307  
   308  pick
   309  ----
   310  L5->L6: 9.2
   311  
   312  # Assume the above two compactions (one manual L0 -> L5 and one automatic
   313  # L5 -> L6) have run, and Lbase = L6 now, but the manual compaction code is
   314  # still going to try running a manual compaction from L5 -> L6 since L5 was the
   315  # output of the last manual compaction. No compaction should be picked.
   316  
   317  init 5
   318  0: 7
   319  6: 5
   320  ----
   321  
   322  init_cp
   323  ----
   324  base: 5
   325  
   326  pick_manual level=5 start=0 end=12
   327  ----
   328  nil, retryLater = false