github.com/cockroachdb/pebble@v1.1.1-0.20240513155919-3622ade60459/testdata/iter_histories/range_key_changed (about) 1 reset 2 ---- 3 4 populate keylen=2 timestamps=(1,3,5) 5 ---- 6 wrote 2106 keys 7 8 batch commit 9 range-key-set a d @1 foo 10 range-key-set d f @1 foo 11 range-key-set f g @2 bar 12 ---- 13 committed 3 keys 14 15 combined-iter 16 seek-ge ba@4 17 next 18 next 19 prev 20 prev 21 seek-ge ba@1 22 seek-ge ca@1 23 seek-ge a 24 prev 25 next 26 prev 27 seek-ge a 28 seek-ge dog 29 seek-ge foo 30 seek-ge f 31 prev 32 next 33 seek-lt f@1 34 ---- 35 ba@4: (., [a-f) @1=foo UPDATED) 36 ba@3: (ba@3, [a-f) @1=foo) 37 ba@1: (ba@1, [a-f) @1=foo) 38 ba@3: (ba@3, [a-f) @1=foo) 39 ba@5: (ba@5, [a-f) @1=foo) 40 ba@1: (ba@1, [a-f) @1=foo) 41 ca@1: (ca@1, [a-f) @1=foo) 42 a: (., [a-f) @1=foo) 43 . 44 a: (., [a-f) @1=foo UPDATED) 45 . 46 a: (., [a-f) @1=foo UPDATED) 47 dog: (., [a-f) @1=foo) 48 foo: (., [f-g) @2=bar UPDATED) 49 f: (., [f-g) @2=bar) 50 ez@1: (ez@1, [a-f) @1=foo UPDATED) 51 f: (., [f-g) @2=bar UPDATED) 52 f@3: (f@3, [f-g) @2=bar) 53 54 combined-iter 55 seek-prefix-ge ba@9 56 seek-prefix-ge ba@5 57 seek-prefix-ge ba@3 58 next 59 seek-prefix-ge da@5 60 next 61 next 62 next 63 seek-prefix-ge da@5 64 ---- 65 ba@9: (., [ba-"ba\x00") @1=foo UPDATED) 66 ba@5: (ba@5, [ba-"ba\x00") @1=foo) 67 ba@3: (ba@3, [ba-"ba\x00") @1=foo) 68 ba@1: (ba@1, [ba-"ba\x00") @1=foo) 69 da@5: (da@5, [da-"da\x00") @1=foo UPDATED) 70 da@3: (da@3, [da-"da\x00") @1=foo) 71 da@1: (da@1, [da-"da\x00") @1=foo) 72 . 73 da@5: (da@5, [da-"da\x00") @1=foo UPDATED) 74 75 # Regression test for #1947 — Test a no-op call to SetBounds. Even if the 76 # underlying iterator doesn't need to be invalidated because the bounds didn't 77 # change, a subsequent Seek that finds the same range key must still report 78 # RangeKeyChanged() -> true. 79 80 reset 81 ---- 82 83 batch commit 84 range-key-set a d @1 foo 85 ---- 86 committed 1 keys 87 88 combined-iter lower=a upper=z 89 last 90 set-bounds lower=a upper=z 91 last 92 set-bounds lower=a upper=z 93 first 94 set-bounds lower=a upper=z 95 seek-ge a 96 set-bounds lower=a upper=z 97 seek-lt z 98 set-bounds lower=a upper=z 99 seek-prefix-ge a 100 set-bounds lower=a upper=z 101 seek-prefix-ge a 102 ---- 103 a: (., [a-d) @1=foo UPDATED) 104 . 105 a: (., [a-d) @1=foo UPDATED) 106 . 107 a: (., [a-d) @1=foo UPDATED) 108 . 109 a: (., [a-d) @1=foo UPDATED) 110 . 111 a: (., [a-d) @1=foo UPDATED) 112 . 113 a: (., [a-"a\x00") @1=foo UPDATED) 114 . 115 a: (., [a-"a\x00") @1=foo UPDATED) 116 117 combined-iter lower=a upper=z 118 last 119 set-options lower=a upper=z 120 last 121 set-options lower=a upper=z 122 first 123 set-options lower=a upper=z 124 seek-ge a 125 set-options lower=a upper=z 126 seek-lt z 127 set-options lower=a upper=z 128 seek-prefix-ge a 129 set-options lower=a upper=z 130 seek-prefix-ge a 131 ---- 132 a: (., [a-d) @1=foo UPDATED) 133 . 134 a: (., [a-d) @1=foo UPDATED) 135 . 136 a: (., [a-d) @1=foo UPDATED) 137 . 138 a: (., [a-d) @1=foo UPDATED) 139 . 140 a: (., [a-d) @1=foo UPDATED) 141 . 142 a: (., [a-"a\x00") @1=foo UPDATED) 143 . 144 a: (., [a-"a\x00") @1=foo UPDATED) 145 146 # Regression test for #1950 — Test a no-op call to SeekGE/SeekLT after a 147 # SetBounds/SetOptions noop. The SetBounds/SetOptions noop made the iterator 148 # appear to be invalidated, but the internal iterator state was preserved. 149 # However, if the previous iterator state had a range key, this range key must 150 # be considered changed for the purpose of calculating RangeKeyChanged(). 151 152 combined-iter lower=a upper=z 153 seek-lt z 154 set-bounds lower=a upper=z 155 seek-lt y 156 seek-ge 1 157 set-bounds lower=a upper=z 158 seek-ge a 159 ---- 160 a: (., [a-d) @1=foo UPDATED) 161 . 162 a: (., [a-d) @1=foo UPDATED) 163 a: (., [a-d) @1=foo) 164 . 165 a: (., [a-d) @1=foo UPDATED) 166 167 combined-iter lower=a upper=z 168 seek-lt z 169 set-options lower=a upper=z 170 seek-lt y 171 seek-ge 1 172 set-options lower=a upper=z 173 seek-ge a 174 ---- 175 a: (., [a-d) @1=foo UPDATED) 176 . 177 a: (., [a-d) @1=foo UPDATED) 178 a: (., [a-d) @1=foo) 179 . 180 a: (., [a-d) @1=foo UPDATED) 181 182 183 # Similar to the above regression, test that a no-op correctly returns 184 # RangeKeyChanged()=false if there's no intervening SetOptions/SetBounds call. 185 186 combined-iter lower=a upper=z 187 seek-lt z 188 seek-lt y 189 set-bounds lower=a upper=z 190 seek-ge 1 191 seek-ge a 192 ---- 193 a: (., [a-d) @1=foo UPDATED) 194 a: (., [a-d) @1=foo) 195 . 196 a: (., [a-d) @1=foo UPDATED) 197 a: (., [a-d) @1=foo) 198 199 combined-iter lower=a upper=z 200 seek-lt z 201 seek-lt y 202 set-options lower=a upper=z 203 seek-ge 1 204 seek-ge a 205 ---- 206 a: (., [a-d) @1=foo UPDATED) 207 a: (., [a-d) @1=foo) 208 . 209 a: (., [a-d) @1=foo UPDATED) 210 a: (., [a-d) @1=foo) 211 212 # Regression test for #1980. An iterator with RangeKeyChanged()=true that is 213 # then reconfigured to iterate over point keys should always return 214 # RangeKeyChanged()=false. 215 216 reset 217 ---- 218 219 batch commit 220 range-key-set a b @1 foo 221 set c c 222 ---- 223 committed 2 keys 224 225 combined-iter 226 seek-ge a 227 set-options key-types=point 228 seek-ge c 229 ---- 230 a: (., [a-b) @1=foo UPDATED) 231 . 232 c: (c, .) 233 234 combined-iter 235 seek-ge a 236 set-options key-types=point 237 seek-prefix-ge c 238 ---- 239 a: (., [a-b) @1=foo UPDATED) 240 . 241 c: (c, .) 242 243 combined-iter 244 seek-ge a 245 set-options key-types=point 246 seek-lt cat 247 ---- 248 a: (., [a-b) @1=foo UPDATED) 249 . 250 c: (c, .) 251 252 combined-iter 253 seek-ge a 254 set-options key-types=point 255 last 256 ---- 257 a: (., [a-b) @1=foo UPDATED) 258 . 259 c: (c, .) 260 261 batch commit 262 range-key-del a b 263 range-key-set d e @1 foo 264 ---- 265 committed 2 keys 266 267 combined-iter 268 seek-ge d 269 set-options key-types=point 270 first 271 ---- 272 d: (., [d-e) @1=foo UPDATED) 273 . 274 c: (c, .)