Mercurial > hg
comparison tests/test-transaction-rollback-on-revlog-split.t @ 50642:05d429fe84ed stable
revlog: fix a bug in revlog splitting
Specifically, if the .i.s files are not added to the transaction,
then a follow-up modification of such a file records it into transaction
as non-empty, which is incorrect.
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Mon, 05 Jun 2023 11:07:08 +0200 |
parents | a445194f0a4d |
children | 12f13b13f414 |
comparison
equal
deleted
inserted
replaced
50622:553865308b15 | 50642:05d429fe84ed |
---|---|
102 $ hg commit -Aqmc | 102 $ hg commit -Aqmc |
103 $ for f in $files; do | 103 $ for f in $files; do |
104 > dd if=/dev/zero of=$f bs=1k count=128 > /dev/null 2>&1 | 104 > dd if=/dev/zero of=$f bs=1k count=128 > /dev/null 2>&1 |
105 > done | 105 > done |
106 $ hg commit -AqmD --traceback | 106 $ hg commit -AqmD --traceback |
107 $ for f in $files; do | |
108 > dd if=/dev/zero of=$f bs=1k count=132 > /dev/null 2>&1 | |
109 > done | |
110 $ hg commit -AqmD --traceback | |
107 | 111 |
108 Reference size: | 112 Reference size: |
109 $ f -s file | 113 $ f -s file |
110 file: size=131072 | 114 file: size=135168 |
111 $ f -s .hg/store/data/file* | 115 $ f -s .hg/store/data/file* |
112 .hg/store/data/file.d: size=132139 | 116 .hg/store/data/file.d: size=267307 |
113 .hg/store/data/file.i: size=256 | 117 .hg/store/data/file.i: size=320 |
114 | 118 |
115 $ cd .. | 119 $ cd .. |
116 | 120 |
117 | 121 |
118 Test a hard crash after the file was split but before the transaction was committed | 122 Test a hard crash after the file was split but before the transaction was committed |
155 #endif | 159 #endif |
156 | 160 |
157 | 161 |
158 The inline revlog still exist, but a split version exist next to it | 162 The inline revlog still exist, but a split version exist next to it |
159 | 163 |
160 $ f -s .hg/store/data/file* | 164 $ cat .hg/store/journal | tr '\0' ' ' | grep '\.s' |
161 .hg/store/data/file.d: size=132139 | 165 [1] |
166 $ f -s .hg/store/data/file* | |
167 .hg/store/data/file.d: size=267307 | |
162 .hg/store/data/file.i: size=132395 | 168 .hg/store/data/file.i: size=132395 |
163 .hg/store/data/file.i.s: size=256 | 169 .hg/store/data/file.i.s: size=320 |
164 | 170 |
165 | 171 |
166 The first file.i entry should match the "Reference size" above. | 172 The first file.i entry should match the "Reference size" above. |
167 The first file.d entry is the temporary record during the split, | 173 The first file.d entry is the temporary record during the split, |
168 | 174 |
235 #endif | 241 #endif |
236 | 242 |
237 The inline revlog still exist, but a split version exist next to it | 243 The inline revlog still exist, but a split version exist next to it |
238 | 244 |
239 $ f -s .hg/store/data/file* | 245 $ f -s .hg/store/data/file* |
240 .hg/store/data/file.d: size=132139 | 246 .hg/store/data/file.d: size=267307 |
241 .hg/store/data/file.i: size=132395 | 247 .hg/store/data/file.i: size=132395 |
242 .hg/store/data/file.i.s: size=256 | 248 .hg/store/data/file.i.s: size=320 |
243 | 249 |
244 $ cat .hg/store/journal | tr -s '\000' ' ' | grep data/file | 250 $ cat .hg/store/journal | tr -s '\000' ' ' | grep data/file |
245 data/file.i 1174 | 251 data/file.i 1174 |
246 data/file.d 0 | 252 data/file.d 0 |
247 | 253 |
300 #endif | 306 #endif |
301 | 307 |
302 The inline revlog was over written on disk | 308 The inline revlog was over written on disk |
303 | 309 |
304 $ f -s .hg/store/data/file* | 310 $ f -s .hg/store/data/file* |
305 .hg/store/data/file.d: size=132139 | 311 .hg/store/data/file.d: size=267307 |
306 .hg/store/data/file.i: size=256 | 312 .hg/store/data/file.i: size=320 |
307 | 313 |
308 $ cat .hg/store/journal | tr -s '\000' ' ' | grep data/file | 314 $ cat .hg/store/journal | tr -s '\000' ' ' | grep data/file |
309 data/file.i 1174 | 315 data/file.i 1174 |
310 data/file.d 0 | 316 data/file.d 0 |
311 | 317 |
432 pulling from ../troffset-computation | 438 pulling from ../troffset-computation |
433 searching for changes | 439 searching for changes |
434 adding changesets | 440 adding changesets |
435 adding manifests | 441 adding manifests |
436 adding file changes | 442 adding file changes |
437 size=131072 | 443 size=135168 |
438 transaction abort! | 444 transaction abort! |
439 rollback completed | 445 rollback completed |
440 abort: pretxnclose.03-abort hook exited with status 1 | 446 abort: pretxnclose.03-abort hook exited with status 1 |
441 [40] | 447 [40] |
442 | 448 |