Commit dfda6eb
committed
Don't waste the last segment of each 4GB logical log file.
The comments claimed that wasting the last segment made it easier to do
calculations with XLogRecPtrs, because you don't have problems representing
last-byte-position-plus-1 that way. In my experience, however, it only made
things more complicated, because the there was two ways to represent the
boundary at the beginning of a logical log file: logid = n+1 and xrecoff = 0,
or as xlogid = n and xrecoff = 4GB - XLOG_SEG_SIZE. Some functions were
picky about which representation was used.
Also, use a 64-bit segment number instead of the log/seg combination, to
point to a certain WAL segment. We assume that all platforms have a working
64-bit integer type nowadays.
This is an incompatible change in WAL format, so bumping WAL version number.1 parent 47c7365 commit dfda6eb
File tree
12 files changed
+415
-556
lines changed- src
- backend
- access/transam
- postmaster
- replication
- bin
- pg_basebackup
- pg_resetxlog
- include/access
12 files changed
+415
-556
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
275 | | - | |
| 274 | + | |
276 | 275 | | |
277 | 276 | | |
278 | 277 | | |
| |||
319 | 318 | | |
320 | 319 | | |
321 | 320 | | |
322 | | - | |
323 | | - | |
| 321 | + | |
| 322 | + | |
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
327 | 326 | | |
328 | 327 | | |
329 | 328 | | |
330 | 329 | | |
331 | | - | |
| 330 | + | |
332 | 331 | | |
333 | 332 | | |
334 | 333 | | |
| |||
354 | 353 | | |
355 | 354 | | |
356 | 355 | | |
357 | | - | |
358 | | - | |
| 356 | + | |
359 | 357 | | |
360 | 358 | | |
361 | 359 | | |
| |||
378 | 376 | | |
379 | 377 | | |
380 | 378 | | |
381 | | - | |
382 | | - | |
| 379 | + | |
| 380 | + | |
383 | 381 | | |
384 | 382 | | |
385 | 383 | | |
| |||
514 | 512 | | |
515 | 513 | | |
516 | 514 | | |
| 515 | + | |
| 516 | + | |
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
| 536 | + | |
| 537 | + | |
547 | 538 | | |
548 | 539 | | |
549 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
550 | 543 | | |
551 | 544 | | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
| 545 | + | |
| 546 | + | |
563 | 547 | | |
564 | 548 | | |
565 | 549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 224 | + | |
| 225 | + | |
228 | 226 | | |
229 | 227 | | |
230 | 228 | | |
| |||
236 | 234 | | |
237 | 235 | | |
238 | 236 | | |
239 | | - | |
240 | | - | |
| 237 | + | |
| 238 | + | |
241 | 239 | | |
242 | 240 | | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
246 | 244 | | |
247 | 245 | | |
248 | | - | |
| 246 | + | |
249 | 247 | | |
250 | 248 | | |
251 | 249 | | |
| |||
254 | 252 | | |
255 | 253 | | |
256 | 254 | | |
257 | | - | |
258 | | - | |
| 255 | + | |
259 | 256 | | |
260 | 257 | | |
261 | 258 | | |
| |||
277 | 274 | | |
278 | 275 | | |
279 | 276 | | |
280 | | - | |
| 277 | + | |
281 | 278 | | |
282 | 279 | | |
283 | | - | |
284 | | - | |
| 280 | + | |
285 | 281 | | |
286 | 282 | | |
287 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
76 | | - | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
484 | | - | |
| 485 | + | |
485 | 486 | | |
486 | 487 | | |
487 | 488 | | |
| |||
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
504 | | - | |
505 | | - | |
| 505 | + | |
| 506 | + | |
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
509 | 510 | | |
510 | | - | |
| 511 | + | |
511 | 512 | | |
512 | | - | |
| 513 | + | |
| 514 | + | |
513 | 515 | | |
514 | 516 | | |
515 | 517 | | |
| |||
527 | 529 | | |
528 | 530 | | |
529 | 531 | | |
530 | | - | |
531 | | - | |
532 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
533 | 535 | | |
534 | 536 | | |
535 | 537 | | |
| |||
544 | 546 | | |
545 | 547 | | |
546 | 548 | | |
547 | | - | |
| 549 | + | |
548 | 550 | | |
549 | | - | |
| 551 | + | |
550 | 552 | | |
551 | 553 | | |
552 | 554 | | |
| |||
575 | 577 | | |
576 | 578 | | |
577 | 579 | | |
578 | | - | |
| 580 | + | |
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
| |||
0 commit comments