github.com/cockroachdb/pebble@v1.1.2/testdata/compaction_picker_concurrency (about) 1 # Test a file L1.000203 that would be a candidate for a move compaction into 2 # L2, except that it's bordered by two files participating in the same 3 # compaction. This is possible if 000203 created by a L0->L1 compaction that 4 # completed after the compaction of 000201 and 000202 began. 5 # 6 # The in-progress compaction of 000201 and 000202 will write an output table 7 # to L2 that would conflict with 000203 if 000203 was moved into L2. 8 # 9 # NB: The L0 files are used to increase the permitted compaction concurrency. 10 define 11 L0 12 000301:a.SET.31-a.SET.31 13 000302:a.SET.32-a.SET.32 14 000303:a.SET.33-a.SET.33 15 000304:a.SET.34-a.SET.34 16 000305:a.SET.35-a.SET.35 17 L1 18 000201:a.SET.21-b.SET.22 19 000203:k.SET.25-n.SET.26 size=512000000 20 000202:x.SET.23-z.SET.24 21 L2 22 000101:a.SET.11-f.SET.12 23 L3 24 000010:a.SET.1-z.SET.2 25 compactions 26 L1 000201 000202 -> L2 000101 27 ---- 28 0.4: 29 000305:[a#35,SET-a#35,SET] 30 0.3: 31 000304:[a#34,SET-a#34,SET] 32 0.2: 33 000303:[a#33,SET-a#33,SET] 34 0.1: 35 000302:[a#32,SET-a#32,SET] 36 0.0: 37 000301:[a#31,SET-a#31,SET] 38 1: 39 000201:[a#21,SET-b#22,SET] 40 000203:[k#25,SET-n#26,SET] 41 000202:[x#23,SET-z#24,SET] 42 2: 43 000101:[a#11,SET-f#12,SET] 44 3: 45 000010:[a#1,SET-z#2,SET] 46 compactions 47 L1 000201 000202 -> L2 000101 48 49 pick-auto l0_compaction_threshold=10 50 ---- 51 nil 52 53 # Test that lowering L0CompactionConcurrency opens up more compaction slots. 54 55 define 56 L0 57 000301:a.SET.31-a.SET.31 58 000302:a.SET.32-a.SET.32 59 000303:a.SET.33-a.SET.33 60 000304:a.SET.34-a.SET.34 61 000305:a.SET.35-a.SET.35 62 L1 63 000201:a.SET.21-b.SET.22 64 000203:k.SET.25-n.SET.26 65 000202:x.SET.23-z.SET.24 66 L2 67 000101:a.SET.11-f.SET.12 68 L3 69 000010:a.SET.1-z.SET.2 70 compactions 71 L1 000202 -> L2 000101 72 ---- 73 0.4: 74 000305:[a#35,SET-a#35,SET] 75 0.3: 76 000304:[a#34,SET-a#34,SET] 77 0.2: 78 000303:[a#33,SET-a#33,SET] 79 0.1: 80 000302:[a#32,SET-a#32,SET] 81 0.0: 82 000301:[a#31,SET-a#31,SET] 83 1: 84 000201:[a#21,SET-b#22,SET] 85 000203:[k#25,SET-n#26,SET] 86 000202:[x#23,SET-z#24,SET] 87 2: 88 000101:[a#11,SET-f#12,SET] 89 3: 90 000010:[a#1,SET-z#2,SET] 91 compactions 92 L1 000202 -> L2 000101 93 94 pick-auto l0_compaction_concurrency=10 95 ---- 96 nil 97 98 pick-auto l0_compaction_concurrency=5 99 ---- 100 L0 -> L1 101 L0: 000301,000302,000303,000304,000305 102 L1: 000201 103 grandparents: 000101 104 105 pick-auto l0_compaction_concurrency=1 106 ---- 107 L0 -> L1 108 L0: 000301,000302,000303,000304,000305 109 L1: 000201 110 grandparents: 000101 111 112 # Test that lowering CompactionDebtConcurrency opens up more concurrent 113 # compaction slots. 114 115 # Test that lowering L0CompactionConcurrency opens up more compaction slots. 116 117 define 118 L0 119 000301:a.SET.31-a.SET.31 size=64000 120 000302:a.SET.32-a.SET.32 size=64000 121 000303:a.SET.33-a.SET.33 size=64000 122 000304:a.SET.34-a.SET.34 size=64000 123 000305:a.SET.35-a.SET.35 size=64000 124 L1 125 000201:a.SET.21-b.SET.22 size=640000 126 000203:k.SET.25-n.SET.26 size=640000 127 000202:x.SET.23-z.SET.24 size=640000 128 L2 129 000101:a.SET.11-f.SET.12 size=6400000 130 L3 131 000010:a.SET.1-z.SET.2 132 compactions 133 L1 000202 -> L2 000101 134 ---- 135 0.4: 136 000305:[a#35,SET-a#35,SET] 137 0.3: 138 000304:[a#34,SET-a#34,SET] 139 0.2: 140 000303:[a#33,SET-a#33,SET] 141 0.1: 142 000302:[a#32,SET-a#32,SET] 143 0.0: 144 000301:[a#31,SET-a#31,SET] 145 1: 146 000201:[a#21,SET-b#22,SET] 147 000203:[k#25,SET-n#26,SET] 148 000202:[x#23,SET-z#24,SET] 149 2: 150 000101:[a#11,SET-f#12,SET] 151 3: 152 000010:[a#1,SET-z#2,SET] 153 compactions 154 L1 000202 -> L2 000101 155 156 pick-auto l0_compaction_concurrency=10 compaction_debt_concurrency=5120000 157 ---- 158 nil 159 160 pick-auto l0_compaction_concurrency=10 compaction_debt_concurrency=512000 161 ---- 162 L0 -> L1 163 L0: 000301,000302,000303,000304,000305 164 L1: 000201 165 grandparents: 000101 166 167 pick-auto l0_compaction_concurrency=5 compaction_debt_concurrency=5120000 168 ---- 169 L0 -> L1 170 L0: 000301,000302,000303,000304,000305 171 L1: 000201 172 grandparents: 000101