forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitef07221
committed
Clean up smgr.c/md.c APIs as per discussion a couple months ago. Instead of
having md.c return a success/failure boolean to smgr.c, which was just goingto elog anyway, let md.c issue the elog messages itself. This allows bettererror reporting, particularly in cases such as "short read" or "short write"which Peter was complaining of. Also, remove the kluge of allowing mdread()to return zeroes from a read-beyond-EOF: this is now an error conditionexcept when InRecovery or zero_damaged_pages = true. (Hash indexes used torequire that behavior, but no more.) Also, enforce that mdwrite() is to beused for rewriting existing blocks while mdextend() is to be used forextending the relation EOF. This restriction lets us get rid of the oldad-hoc defense against creating huge files by an accidental reference toa bogus block number: we'll only create new segments in mdextend() notmdwrite() or mdread(). (Again, when InRecovery we allow it anyway, sincewe need to allow updates of blocks that were later truncated away.)Also, clean up the original makeshift patch for bug #2737: move theresponsibility for padding relation segments to full length into md.c.1 parent990fea8 commitef07221
File tree
6 files changed
+402
-398
lines changed- src
- backend
- access
- hash
- nbtree
- commands
- storage/smgr
- include/storage
6 files changed
+402
-398
lines changedLines changed: 4 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
533 | 533 |
| |
534 | 534 |
| |
535 | 535 |
| |
536 |
| - | |
537 |
| - | |
538 |
| - | |
539 |
| - | |
| 536 | + | |
| 537 | + | |
540 | 538 |
| |
541 | 539 |
| |
542 | 540 |
| |
| |||
559 | 557 |
| |
560 | 558 |
| |
561 | 559 |
| |
562 |
| - | |
563 | 560 |
| |
564 | 561 |
| |
565 | 562 |
| |
| |||
577 | 574 |
| |
578 | 575 |
| |
579 | 576 |
| |
580 |
| - | |
581 |
| - | |
582 | 577 |
| |
583 | 578 |
| |
584 |
| - | |
585 |
| - | |
586 |
| - | |
587 |
| - | |
588 |
| - | |
589 |
| - | |
590 |
| - | |
591 |
| - | |
592 |
| - | |
593 |
| - | |
594 |
| - | |
595 |
| - | |
596 |
| - | |
597 |
| - | |
| 579 | + | |
598 | 580 |
| |
599 | 581 |
| |
600 | 582 |
| |
|
Lines changed: 16 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 |
| - | |
40 |
| - | |
41 |
| - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| |||
309 | 309 |
| |
310 | 310 |
| |
311 | 311 |
| |
312 |
| - | |
313 |
| - | |
314 |
| - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
315 | 315 |
| |
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
319 | 319 |
| |
320 | 320 |
| |
321 | 321 |
| |
322 |
| - | |
323 |
| - | |
324 | 322 |
| |
| 323 | + | |
| 324 | + | |
| 325 | + | |
325 | 326 |
| |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
326 | 333 |
| |
327 | 334 |
| |
328 | 335 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
6083 | 6083 |
| |
6084 | 6084 |
| |
6085 | 6085 |
| |
6086 |
| - | |
| 6086 | + | |
6087 | 6087 |
| |
6088 | 6088 |
| |
6089 | 6089 |
| |
|
0 commit comments
Comments
(0)