github.com/cockroachdb/pebble@v1.1.1-0.20240513155919-3622ade60459/testdata/excise (about) 1 2 build ext0 format=pebblev2 3 set a 1 4 set l 2 5 ---- 6 7 ingest ext0 8 ---- 9 10 lsm 11 ---- 12 6: 13 000004:[a#10,SET-l#10,SET] 14 15 16 batch 17 set d foo 18 set f bar 19 ---- 20 21 flush 22 ---- 23 24 lsm 25 ---- 26 0.0: 27 000006:[d#11,SET-f#12,SET] 28 6: 29 000004:[a#10,SET-l#10,SET] 30 31 excise c k 32 ---- 33 would excise 2 files, use ingest-and-excise to excise. 34 deleted: L0 000006 35 deleted: L6 000004 36 added: L6 000007:[a#10,SET-a#10,SET] seqnums:[10-10] points:[a#10,SET-a#10,SET] 37 added: L6 000008:[l#10,SET-l#10,SET] seqnums:[10-10] points:[l#10,SET-l#10,SET] 38 39 40 excise a e 41 ---- 42 would excise 2 files, use ingest-and-excise to excise. 43 deleted: L0 000006 44 deleted: L6 000004 45 added: L0 000009:[f#12,SET-f#12,SET] seqnums:[11-12] points:[f#12,SET-f#12,SET] 46 added: L6 000010:[l#10,SET-l#10,SET] seqnums:[10-10] points:[l#10,SET-l#10,SET] 47 48 excise e z 49 ---- 50 would excise 2 files, use ingest-and-excise to excise. 51 deleted: L0 000006 52 deleted: L6 000004 53 added: L0 000011:[d#11,SET-d#11,SET] seqnums:[11-12] points:[d#11,SET-d#11,SET] 54 added: L6 000012:[a#10,SET-a#10,SET] seqnums:[10-10] points:[a#10,SET-a#10,SET] 55 56 excise f l 57 ---- 58 would excise 2 files, use ingest-and-excise to excise. 59 deleted: L0 000006 60 deleted: L6 000004 61 added: L0 000013:[d#11,SET-d#11,SET] seqnums:[11-12] points:[d#11,SET-d#11,SET] 62 added: L6 000014:[a#10,SET-a#10,SET] seqnums:[10-10] points:[a#10,SET-a#10,SET] 63 added: L6 000015:[l#10,SET-l#10,SET] seqnums:[10-10] points:[l#10,SET-l#10,SET] 64 65 excise f ll 66 ---- 67 would excise 2 files, use ingest-and-excise to excise. 68 deleted: L0 000006 69 deleted: L6 000004 70 added: L0 000016:[d#11,SET-d#11,SET] seqnums:[11-12] points:[d#11,SET-d#11,SET] 71 added: L6 000017:[a#10,SET-a#10,SET] seqnums:[10-10] points:[a#10,SET-a#10,SET] 72 73 excise p q 74 ---- 75 would excise 0 files, use ingest-and-excise to excise. 76 77 lsm 78 ---- 79 0.0: 80 000006:[d#11,SET-f#12,SET] 81 6: 82 000004:[a#10,SET-l#10,SET] 83 84 iter 85 first 86 next 87 next 88 next 89 next 90 ---- 91 a: (1, .) 92 d: (foo, .) 93 f: (bar, .) 94 l: (2, .) 95 . 96 97 build ext1 format=pebblev2 98 set d foo3 99 set e bar2 100 ---- 101 102 ingest-and-excise ext1 excise=c-k 103 ---- 104 105 lsm 106 ---- 107 6: 108 000019:[a#10,SET-a#10,SET] 109 000018:[d#13,SET-e#13,SET] 110 000020:[l#10,SET-l#10,SET] 111 112 iter 113 first 114 next 115 next 116 next 117 next 118 ---- 119 a: (1, .) 120 d: (foo3, .) 121 e: (bar2, .) 122 l: (2, .) 123 . 124 125 # More complex cases, with the truncation of file bounds happening at rangedel 126 # and rangekey bounds. 127 128 reset 129 ---- 130 131 build ext3 format=pebblev2 132 range-key-set c f @4 foobar 133 ---- 134 135 ingest ext3 136 ---- 137 138 build ext4 format=pebblev2 139 set b bar 140 del-range g i 141 ---- 142 143 ingest ext4 144 ---- 145 146 lsm 147 ---- 148 0.0: 149 000005:[b#11,SET-i#inf,RANGEDEL] 150 6: 151 000004:[c#10,RANGEKEYSET-f#inf,RANGEKEYSET] 152 153 excise f g 154 ---- 155 would excise 1 files, use ingest-and-excise to excise. 156 deleted: L0 000005 157 added: L0 000006:[b#11,SET-b#11,SET] seqnums:[11-11] points:[b#11,SET-b#11,SET] 158 added: L0 000007:[g#11,RANGEDEL-i#inf,RANGEDEL] seqnums:[11-11] points:[g#11,RANGEDEL-i#inf,RANGEDEL] 159 160 excise b c 161 ---- 162 would excise 1 files, use ingest-and-excise to excise. 163 deleted: L0 000005 164 added: L0 000008:[g#11,RANGEDEL-i#inf,RANGEDEL] seqnums:[11-11] points:[g#11,RANGEDEL-i#inf,RANGEDEL] 165 166 excise i j 167 ---- 168 would excise 0 files, use ingest-and-excise to excise. 169 170 # Excise mid range key. This will not happen in practice, but excise() 171 # supports it. 172 173 excise c d 174 ---- 175 would excise 2 files, use ingest-and-excise to excise. 176 deleted: L0 000005 177 deleted: L6 000004 178 added: L0 000009:[b#11,SET-b#11,SET] seqnums:[11-11] points:[b#11,SET-b#11,SET] 179 added: L0 000010:[g#11,RANGEDEL-i#inf,RANGEDEL] seqnums:[11-11] points:[g#11,RANGEDEL-i#inf,RANGEDEL] 180 added: L6 000011:[d#10,RANGEKEYSET-f#inf,RANGEKEYSET] seqnums:[10-10] ranges:[d#10,RANGEKEYSET-f#inf,RANGEKEYSET] 181 182 reset 183 ---- 184 185 # Create an sstable with a range key set. 186 batch 187 set a a 188 set b b 189 set d d 190 range-key-set e ee @1 foo 191 ---- 192 193 flush 194 ---- 195 196 lsm 197 ---- 198 0.0: 199 000005:[a#10,SET-ee#inf,RANGEKEYSET] 200 201 build ext2 202 set z z 203 ---- 204 205 ingest-and-excise ext2 excise=b-c 206 ---- 207 208 lsm 209 ---- 210 0.0: 211 000007:[a#10,SET-a#10,SET] 212 000008:[d#12,SET-ee#inf,RANGEKEYSET] 213 6: 214 000006:[z#14,SET-z#14,SET] 215 216 # Regression test for https://github.com/cockroachdb/pebble/issues/2947. 217 reset 218 ---- 219 220 batch 221 set a a 222 set b b 223 set c c 224 set d d 225 set e e 226 set f f 227 set g g 228 set h h 229 set i i 230 set j j 231 ---- 232 233 flush 234 ---- 235 236 lsm 237 ---- 238 0.0: 239 000005:[a#10,SET-j#19,SET] 240 241 build ext2 242 set z z 243 ---- 244 245 ingest-and-excise ext2 excise=d-e 246 ---- 247 248 lsm 249 ---- 250 0.0: 251 000007:[a#10,SET-c#12,SET] 252 000008:[e#14,SET-j#19,SET] 253 6: 254 000006:[z#20,SET-z#20,SET] 255 256 build ext3 257 set zz zz 258 ---- 259 260 ingest-and-excise ext3 excise=g-h 261 ---- 262 263 # 7, 10, 11 should have the same file backing struct. 264 lsm 265 ---- 266 0.0: 267 000007:[a#10,SET-c#12,SET] 268 000010:[e#14,SET-f#15,SET] 269 000011:[h#17,SET-j#19,SET] 270 6: 271 000006:[z#20,SET-z#20,SET] 272 000009:[zz#21,SET-zz#21,SET] 273 274 confirm-backing 7 10 11 275 ---- 276 file backings are the same 277 278 reopen 279 ---- 280 281 # 7, 10, 11 should still have the same file backing struct even after manifest 282 # replay. 283 lsm 284 ---- 285 0.0: 286 000007:[a#10,SET-c#12,SET] 287 000010:[e#14,SET-f#15,SET] 288 000011:[h#17,SET-j#19,SET] 289 6: 290 000006:[z#20,SET-z#20,SET] 291 000009:[zz#21,SET-zz#21,SET] 292 293 confirm-backing 7 10 11 294 ---- 295 file backings are the same 296 297 # Excise one boundary, the file backing should still be set. 298 reset 299 ---- 300 301 batch 302 set a a 303 set b b 304 set c c 305 set d d 306 set e e 307 ---- 308 309 flush 310 ---- 311 312 lsm 313 ---- 314 0.0: 315 000005:[a#10,SET-e#14,SET] 316 317 build ext2 318 set z z 319 ---- 320 321 ingest-and-excise ext2 excise=d-f 322 ---- 323 324 lsm 325 ---- 326 0.0: 327 000007:[a#10,SET-c#12,SET] 328 6: 329 000006:[z#15,SET-z#15,SET] 330 331 reopen 332 ---- 333 334 lsm 335 ---- 336 0.0: 337 000007:[a#10,SET-c#12,SET] 338 6: 339 000006:[z#15,SET-z#15,SET]