github.com/cockroachdb/pebble@v1.1.1-0.20240513155919-3622ade60459/internal/manifest/testdata/version_check_ordering (about) 1 # Note: when specifying test cases with tables in L0, the L0 files should be 2 # specified in seqnum descending order, as the test case input is parsed as the 3 # inverse of `(*FileMetadata).DebugString`. 4 5 check-ordering 6 0: 7 000001:[a#1,SET-b#2,SET] 8 ---- 9 OK 10 11 check-ordering 12 0: 13 000002:[c#3,SET-d#4,SET] 14 000001:[a#1,SET-b#2,SET] 15 ---- 16 OK 17 18 check-ordering 19 0: 20 000002:[a#1,SET-b#2,SET] 21 000001:[c#3,SET-d#4,SET] 22 ---- 23 L0 files 000001 and 000002 are not properly ordered: <#3-#4> vs <#1-#2> 24 0.0: 25 000002:[a#1,SET-b#2,SET] seqnums:[1-2] points:[a#1,SET-b#2,SET] 26 000001:[c#3,SET-d#4,SET] seqnums:[3-4] points:[c#3,SET-d#4,SET] 27 28 check-ordering 29 0: 30 000008:[k#16,SET-n#19,SET] 31 000007:[a#14,SET-j#17,SET] 32 000006:[b#15,SET-d#15,SET] 33 000005:[i#8,SET-j#13,SET] 34 000004:[g#6,SET-h#12,SET] 35 000003:[e#2,SET-f#7,SET] 36 000002:[a#1,SET-b#5,SET] 37 000001:[c#3,SET-d#4,SET] 38 ---- 39 OK 40 41 # Add some ingested SSTables around the 14-19 seqnum cases. 42 check-ordering 43 0: 44 000010:[m#20,SET-n#20,SET] 45 000009:[k#16,SET-n#19,SET] 46 000008:[m#18,SET-n#18,SET] 47 000007:[a#14,SET-j#17,SET] 48 000006:[b#15,SET-d#15,SET] 49 000005:[i#8,SET-j#13,SET] 50 000004:[g#6,SET-h#12,SET] 51 000003:[e#2,SET-f#7,SET] 52 000002:[a#1,SET-b#5,SET] 53 000001:[c#3,SET-d#4,SET] 54 ---- 55 OK 56 57 # Coincident sequence numbers around sstables with overlapping sequence numbers 58 # are possible due to flush splitting, so this is acceptable. 59 check-ordering 60 0: 61 000010:[m#20,SET-n#20,SET] 62 000009:[k#16,SET-n#19,SET] 63 000008:[m#18,SET-n#18,SET] 64 000007:[a#15,SET-j#17,SET] 65 000006:[b#15,SET-d#15,SET] 66 000005:[i#8,SET-j#13,SET] 67 000004:[g#6,SET-h#12,SET] 68 000003:[e#2,SET-f#7,SET] 69 000002:[a#1,SET-b#5,SET] 70 000001:[c#3,SET-d#4,SET] 71 ---- 72 OK 73 74 # Ensure that sstables passed in a non-sorted order are detected. 75 check-ordering 76 0: 77 000002:[a#1,SET-b#2,SET] 78 000001:[a#3,SET-d#3,SET] 79 ---- 80 L0 files 000001 and 000002 are not properly ordered: <#3-#3> vs <#1-#2> 81 0.1: 82 000002:[a#1,SET-b#2,SET] seqnums:[1-2] points:[a#1,SET-b#2,SET] 83 0.0: 84 000001:[a#3,SET-d#3,SET] seqnums:[3-3] points:[a#3,SET-d#3,SET] 85 86 check-ordering 87 0: 88 000002:[a#3,SET-b#3,SET] 89 000001:[a#2,SET-d#4,SET] 90 ---- 91 L0 files 000001 and 000002 are not properly ordered: <#2-#4> vs <#3-#3> 92 0.1: 93 000002:[a#3,SET-b#3,SET] seqnums:[3-3] points:[a#3,SET-b#3,SET] 94 0.0: 95 000001:[a#2,SET-d#4,SET] seqnums:[2-4] points:[a#2,SET-d#4,SET] 96 97 check-ordering 98 0: 99 000002:[a#3,SET-b#3,SET] 100 000001:[a#3,SET-d#3,SET] 101 ---- 102 OK 103 104 check-ordering 105 0: 106 000002:[a#3,SET-d#5,SET] 107 000001:[a#3,SET-d#3,SET] 108 ---- 109 OK 110 111 check-ordering 112 0: 113 000002:[a#3,SET-d#5,SET] 114 000001:[a#4,SET-d#4,SET] 115 ---- 116 OK 117 118 check-ordering 119 0: 120 000002:[a#5,SET-d#5,SET] 121 000001:[a#3,SET-d#5,SET] 122 ---- 123 OK 124 125 check-ordering 126 0: 127 000003:[a#4,SET-d#6,SET] 128 000002:[a#5,SET-d#5,SET] 129 000001:[a#4,SET-d#4,SET] 130 ---- 131 OK 132 133 check-ordering 134 0: 135 000003:[a#0,SET-d#3,SET] 136 000002:[a#0,SET-d#0,SET] 137 000001:[a#0,SET-d#0,SET] 138 ---- 139 OK 140 141 check-ordering 142 1: 143 000001:[a#1,SET-b#2,SET] 144 ---- 145 OK 146 147 check-ordering 148 1: 149 000001:[b#1,SET-a#2,SET] 150 ---- 151 L1 : file 000001 has inconsistent bounds: b#1,SET vs a#2,SET 152 1: 153 000001:[b#1,SET-a#2,SET] seqnums:[0-0] points:[b#1,SET-a#2,SET] 154 155 check-ordering 156 1: 157 000001:[a#1,SET-b#2,SET] 158 000002:[c#3,SET-d#4,SET] 159 ---- 160 OK 161 162 check-ordering 163 1: 164 000001:[a#1,SET-b#2,SET] 165 000002:[d#3,SET-c#4,SET] 166 ---- 167 L1 : file 000002 has inconsistent bounds: d#3,SET vs c#4,SET 168 1: 169 000001:[a#1,SET-b#2,SET] seqnums:[0-0] points:[a#1,SET-b#2,SET] 170 000002:[d#3,SET-c#4,SET] seqnums:[0-0] points:[d#3,SET-c#4,SET] 171 172 check-ordering 173 1: 174 000001:[a#1,SET-b#2,SET] 175 000002:[b#1,SET-d#4,SET] 176 ---- 177 L1 files 000001 and 000002 have overlapping ranges: [a#1,SET-b#2,SET] vs [b#1,SET-d#4,SET] 178 1: 179 000001:[a#1,SET-b#2,SET] seqnums:[0-0] points:[a#1,SET-b#2,SET] 180 000002:[b#1,SET-d#4,SET] seqnums:[0-0] points:[b#1,SET-d#4,SET] 181 182 check-ordering allow-split-user-keys 183 1: 184 000001:[a#1,SET-b#2,SET] 185 000002:[b#1,SET-d#4,SET] 186 ---- 187 OK 188 189 check-ordering 190 1: 191 000001:[a#1,SET-b#2,SET] 192 000002:[b#2,SET-d#4,SET] 193 ---- 194 L1 files 000001 and 000002 have overlapping ranges: [a#1,SET-b#2,SET] vs [b#2,SET-d#4,SET] 195 1: 196 000001:[a#1,SET-b#2,SET] seqnums:[0-0] points:[a#1,SET-b#2,SET] 197 000002:[b#2,SET-d#4,SET] seqnums:[0-0] points:[b#2,SET-d#4,SET] 198 199 check-ordering 200 1: 201 000001:[a#1,SET-c#2,SET] 202 000002:[b#3,SET-d#4,SET] 203 ---- 204 L1 files 000001 and 000002 have overlapping ranges: [a#1,SET-c#2,SET] vs [b#3,SET-d#4,SET] 205 1: 206 000001:[a#1,SET-c#2,SET] seqnums:[0-0] points:[a#1,SET-c#2,SET] 207 000002:[b#3,SET-d#4,SET] seqnums:[0-0] points:[b#3,SET-d#4,SET] 208 209 check-ordering 210 1: 211 000001:[a#1,SET-c#2,SET] 212 2: 213 000002:[b#3,SET-d#4,SET] 214 ---- 215 OK 216 217 check-ordering 218 1: 219 000001:[a#1,SET-c#2,SET] 220 2: 221 000002:[b#3,SET-d#4,SET] 222 000003:[c#5,SET-e#6,SET] 223 ---- 224 L2 files 000002 and 000003 have overlapping ranges: [b#3,SET-d#4,SET] vs [c#5,SET-e#6,SET] 225 1: 226 000001:[a#1,SET-c#2,SET] seqnums:[0-0] points:[a#1,SET-c#2,SET] 227 2: 228 000002:[b#3,SET-d#4,SET] seqnums:[0-0] points:[b#3,SET-d#4,SET] 229 000003:[c#5,SET-e#6,SET] seqnums:[0-0] points:[c#5,SET-e#6,SET] 230 231 # Ordering considers tables with just range keys. 232 233 check-ordering 234 0: 235 000002:[c#3,RANGEKEYSET-d#inf,RANGEKEYSET] ranges:[c#3,RANGEKEYSET-d#inf,RANGEKEYSET] 236 000001:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 237 ---- 238 OK 239 240 check-ordering 241 0: 242 000002:[c#1,RANGEKEYSET-d#inf,RANGEKEYSET] ranges:[c#1,RANGEKEYSET-d#inf,RANGEKEYSET] 243 000001:[a#3,RANGEKEYSET-b#inf,RANGEKEYSET] ranges:[a#3,RANGEKEYSET-b#inf,RANGEKEYSET] 244 ---- 245 L0 files 000001 and 000002 are not properly ordered: <#3-#72057594037927935> vs <#1-#72057594037927935> 246 0.0: 247 000001:[a#3,RANGEKEYSET-b#inf,RANGEKEYSET] seqnums:[3-72057594037927935] ranges:[a#3,RANGEKEYSET-b#inf,RANGEKEYSET] 248 000002:[c#1,RANGEKEYSET-d#inf,RANGEKEYSET] seqnums:[1-72057594037927935] ranges:[c#1,RANGEKEYSET-d#inf,RANGEKEYSET] 249 250 check-ordering 251 1: 252 000001:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 253 000002:[c#3,RANGEKEYSET-d#inf,RANGEKEYSET] ranges:[c#3,RANGEKEYSET-d#inf,RANGEKEYSET] 254 ---- 255 OK 256 257 check-ordering 258 1: 259 000001:[c#3,RANGEKEYSET-d#inf,RANGEKEYSET] ranges:[c#3,RANGEKEYSET-d#inf,RANGEKEYSET] 260 000002:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 261 ---- 262 L1 files 000001 and 000002 are not properly ordered: [c#3,RANGEKEYSET-d#inf,RANGEKEYSET] vs [a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 263 1: 264 000001:[c#3,RANGEKEYSET-d#inf,RANGEKEYSET] seqnums:[0-0] ranges:[c#3,RANGEKEYSET-d#inf,RANGEKEYSET] 265 000002:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] seqnums:[0-0] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 266 267 # Ordering considers tables with both point and range keys. 268 269 check-ordering 270 0: 271 000002:[c#1,RANGEKEYSET-e#4,SET] points:[d#3,SET-e#4,SET] ranges:[c#1,RANGEKEYSET-d#inf,RANGEKEYSET] 272 000001:[a#1,RANGEKEYSET-c#2,SET] points:[b#1,SET-c#2,SET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 273 ---- 274 OK 275 276 check-ordering 277 0: 278 000002:[c#1,RANGEKEYSET-e#2,SET] points:[d#3,SET-e#2,SET] ranges:[c#1,RANGEKEYSET-d#inf,RANGEKEYSET] 279 000001:[a#1,RANGEKEYSET-c#4,SET] points:[b#1,SET-c#4,SET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 280 ---- 281 L0 files 000001 and 000002 are not properly ordered: <#1-#4> vs <#1-#2> 282 0.1: 283 000002:[c#1,RANGEKEYSET-e#2,SET] seqnums:[1-2] points:[d#3,SET-e#2,SET] ranges:[c#1,RANGEKEYSET-d#inf,RANGEKEYSET] 284 0.0: 285 000001:[a#1,RANGEKEYSET-c#4,SET] seqnums:[1-4] points:[b#1,SET-c#4,SET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 286 287 check-ordering 288 1: 289 000001:[a#1,RANGEKEYSET-c#2,SET] points:[b#1,SET-c#2,SET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 290 000002:[d#3,RANGEKEYSET-f#4,SET] points:[e#3,SET-f#4,SET] ranges:[d#3,RANGEKEYSET-e#inf,RANGEKEYSET] 291 ---- 292 OK 293 294 check-ordering 295 1: 296 000001:[a#1,RANGEKEYSET-c#2,SET] points:[b#1,SET-c#2,SET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 297 000002:[c#3,RANGEKEYSET-f#4,SET] points:[e#3,SET-f#4,SET] ranges:[c#3,RANGEKEYSET-e#inf,RANGEKEYSET] 298 ---- 299 L1 files 000001 and 000002 have overlapping ranges: [a#1,RANGEKEYSET-c#2,SET] vs [c#3,RANGEKEYSET-f#4,SET] 300 1: 301 000001:[a#1,RANGEKEYSET-c#2,SET] seqnums:[0-0] points:[b#1,SET-c#2,SET] ranges:[a#1,RANGEKEYSET-b#inf,RANGEKEYSET] 302 000002:[c#3,RANGEKEYSET-f#4,SET] seqnums:[0-0] points:[e#3,SET-f#4,SET] ranges:[c#3,RANGEKEYSET-e#inf,RANGEKEYSET]