- Notifications
You must be signed in to change notification settings - Fork5
Commit25216c9
committed
Remove _hash_wrtbuf() in favor of calling MarkBufferDirty().
The whole concept of _hash_wrtbuf() is that we need to know at thetime we're releasing the buffer lock (and pin) whether we dirtied thebuffer, but this is easy to get wrong. This patch actually fixes onenon-obvious bug of that form: hashbucketcleanup forgot to signal_hash_squeezebucket, which gets the primary bucket page alreadylocked, as to whether it had already dirtied the page. CallingMarkBufferDirty() at the places where we dirty the buffer is moreintuitive and lets us simplify the code in various places as well.On top of all that, the ultimate goal here is to make hash indexesWAL-logged, and as the comments to _hash_wrtbuf() note, it shouldgo away when that happens. Making it go away a little earlier thanthat seems like a good preparatory step.Report by Jeff Janes. Diagnosis by Amit Kapila, Kuntal Ghosh,and Dilip Kumar. Patch by me, after studying an alternative patchsubmitted by Amit Kapila.Discussion:http://postgr.es/m/CAA4eK1Kf6tOY0oVz_SEdngiNFkeXrA3xUSDPPORQvsWVPdKqnA@mail.gmail.com1 parent4f5182e commit25216c9
File tree
5 files changed
+41
-63
lines changed- src
- backend/access/hash
- include/access
5 files changed
+41
-63
lines changedLines changed: 6 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
635 | 635 |
| |
636 | 636 |
| |
637 | 637 |
| |
638 |
| - | |
| 638 | + | |
| 639 | + | |
639 | 640 |
| |
640 | 641 |
| |
641 | 642 |
| |
| |||
724 | 725 |
| |
725 | 726 |
| |
726 | 727 |
| |
727 |
| - | |
728 | 728 |
| |
729 | 729 |
| |
730 | 730 |
| |
| |||
805 | 805 |
| |
806 | 806 |
| |
807 | 807 |
| |
808 |
| - | |
| 808 | + | |
809 | 809 |
| |
810 | 810 |
| |
811 | 811 |
| |
| |||
820 | 820 |
| |
821 | 821 |
| |
822 | 822 |
| |
823 |
| - | |
824 |
| - | |
825 |
| - | |
826 |
| - | |
827 |
| - | |
828 |
| - | |
829 |
| - | |
830 |
| - | |
831 |
| - | |
| 823 | + | |
832 | 824 |
| |
833 | 825 |
| |
834 | 826 |
| |
| |||
862 | 854 |
| |
863 | 855 |
| |
864 | 856 |
| |
| 857 | + | |
865 | 858 |
| |
866 | 859 |
| |
867 | 860 |
| |
| |||
873 | 866 |
| |
874 | 867 |
| |
875 | 868 |
| |
876 |
| - | |
| 869 | + | |
877 | 870 |
| |
878 | 871 |
| |
879 | 872 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
208 | 208 |
| |
209 | 209 |
| |
210 | 210 |
| |
211 |
| - | |
| 211 | + | |
212 | 212 |
| |
213 | 213 |
| |
214 | 214 |
| |
215 |
| - | |
| 215 | + | |
| 216 | + | |
216 | 217 |
| |
217 | 218 |
| |
218 | 219 |
| |
|
Lines changed: 24 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
| 152 | + | |
152 | 153 |
| |
153 |
| - | |
| 154 | + | |
154 | 155 |
| |
155 |
| - | |
| 156 | + | |
156 | 157 |
| |
157 | 158 |
| |
158 | 159 |
| |
| |||
304 | 305 |
| |
305 | 306 |
| |
306 | 307 |
| |
307 |
| - | |
| 308 | + | |
| 309 | + | |
308 | 310 |
| |
309 | 311 |
| |
310 | 312 |
| |
| |||
416 | 418 |
| |
417 | 419 |
| |
418 | 420 |
| |
419 |
| - | |
| 421 | + | |
| 422 | + | |
420 | 423 |
| |
421 | 424 |
| |
422 | 425 |
| |
| |||
445 | 448 |
| |
446 | 449 |
| |
447 | 450 |
| |
448 |
| - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
449 | 455 |
| |
450 | 456 |
| |
451 | 457 |
| |
| |||
466 | 472 |
| |
467 | 473 |
| |
468 | 474 |
| |
469 |
| - | |
| 475 | + | |
| 476 | + | |
470 | 477 |
| |
471 | 478 |
| |
472 | 479 |
| |
| |||
494 | 501 |
| |
495 | 502 |
| |
496 | 503 |
| |
497 |
| - | |
| 504 | + | |
| 505 | + | |
498 | 506 |
| |
499 | 507 |
| |
500 | 508 |
| |
| |||
503 | 511 |
| |
504 | 512 |
| |
505 | 513 |
| |
506 |
| - | |
507 |
| - | |
508 |
| - | |
509 |
| - | |
510 |
| - | |
511 |
| - | |
| 514 | + | |
512 | 515 |
| |
| 516 | + | |
513 | 517 |
| |
514 | 518 |
| |
515 | 519 |
| |
| |||
559 | 563 |
| |
560 | 564 |
| |
561 | 565 |
| |
562 |
| - | |
563 |
| - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
564 | 569 |
| |
565 | 570 |
| |
566 | 571 |
| |
| |||
724 | 729 |
| |
725 | 730 |
| |
726 | 731 |
| |
727 |
| - | |
728 |
| - | |
729 |
| - | |
730 |
| - | |
731 |
| - | |
732 |
| - | |
733 |
| - | |
| 732 | + | |
| 733 | + | |
734 | 734 |
| |
735 | 735 |
| |
736 | 736 |
| |
| |||
742 | 742 |
| |
743 | 743 |
| |
744 | 744 |
| |
745 |
| - | |
| 745 | + | |
746 | 746 |
| |
747 |
| - | |
748 |
| - | |
| 747 | + | |
749 | 748 |
| |
750 | 749 |
| |
751 | 750 |
| |
|
Lines changed: 8 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
289 | 289 |
| |
290 | 290 |
| |
291 | 291 |
| |
292 |
| - | |
293 |
| - | |
294 |
| - | |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
299 |
| - | |
300 |
| - | |
301 |
| - | |
302 |
| - | |
303 |
| - | |
304 |
| - | |
305 |
| - | |
306 |
| - | |
307 |
| - | |
308 |
| - | |
309 |
| - | |
310 |
| - | |
311 | 292 |
| |
312 | 293 |
| |
313 | 294 |
| |
| |||
483 | 464 |
| |
484 | 465 |
| |
485 | 466 |
| |
486 |
| - | |
| 467 | + | |
| 468 | + | |
487 | 469 |
| |
488 | 470 |
| |
489 | 471 |
| |
| |||
495 | 477 |
| |
496 | 478 |
| |
497 | 479 |
| |
498 |
| - | |
| 480 | + | |
| 481 | + | |
499 | 482 |
| |
500 | 483 |
| |
501 | 484 |
| |
| |||
1075 | 1058 |
| |
1076 | 1059 |
| |
1077 | 1060 |
| |
1078 |
| - | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1079 | 1065 |
| |
1080 | 1066 |
| |
1081 | 1067 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
336 | 336 |
| |
337 | 337 |
| |
338 | 338 |
| |
339 |
| - | |
340 | 339 |
| |
341 | 340 |
| |
342 | 341 |
| |
|
0 commit comments
Comments
(0)