forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit909eebf
committed
dshash: revise sequential scan support.
The previous coding of dshash_seq_next(), on the first call, accessedstatus->hash_table->size_log2 without holding a partition lock and withoutguaranteeing that ensure_valid_bucket_pointers() had ever been called.That oversight turns out to not have immediately visible effects, becausebucket 0 is always in partition 0, and ensure_valid_bucket_pointers() wascalled after acquiring the partition lock. However,PARTITION_FOR_BUCKET_INDEX() with a size_log2 of 0 ends up triggering formallyundefined behaviour.Simplify by accessing partition 0, without using PARTITION_FOR_BUCKET_INDEX().While at it, remove dshash_get_current(), there is no convincing usecase. Also polish a few comments.Author: Andres Freund <andres@anarazel.de>Reviewed-By: Thomas Munro <thomas.munro@gmail.com>Discussion:https://postgr.es/m/CA+hUKGL9hY_VY=+oUK+Gc1iSRx-Ls5qeYJ6q=dQVZnT3R63Taw@mail.gmail.com1 parent55e566f commit909eebf
2 files changed
+27
-30
lines changedLines changed: 27 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
601 | 601 |
| |
602 | 602 |
| |
603 | 603 |
| |
604 |
| - | |
605 |
| - | |
606 |
| - | |
| 604 | + | |
| 605 | + | |
607 | 606 |
| |
608 |
| - | |
609 |
| - | |
610 |
| - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
611 | 610 |
| |
612 | 611 |
| |
613 | 612 |
| |
| |||
625 | 624 |
| |
626 | 625 |
| |
627 | 626 |
| |
628 |
| - | |
629 |
| - | |
| 627 | + | |
| 628 | + | |
630 | 629 |
| |
631 | 630 |
| |
632 | 631 |
| |
633 | 632 |
| |
634 | 633 |
| |
635 | 634 |
| |
636 |
| - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
637 | 645 |
| |
638 |
| - | |
639 |
| - | |
640 | 646 |
| |
641 | 647 |
| |
642 | 648 |
| |
643 |
| - | |
644 |
| - | |
645 |
| - | |
646 |
| - | |
647 |
| - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
648 | 653 |
| |
649 |
| - | |
650 | 654 |
| |
651 |
| - | |
652 |
| - | |
653 |
| - | |
654 | 655 |
| |
655 | 656 |
| |
| 657 | + | |
| 658 | + | |
656 | 659 |
| |
657 | 660 |
| |
658 | 661 |
| |
| |||
714 | 717 |
| |
715 | 718 |
| |
716 | 719 |
| |
717 |
| - | |
| 720 | + | |
718 | 721 |
| |
719 | 722 |
| |
720 | 723 |
| |
| |||
726 | 729 |
| |
727 | 730 |
| |
728 | 731 |
| |
729 |
| - | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
730 | 735 |
| |
731 | 736 |
| |
732 | 737 |
| |
| |||
746 | 751 |
| |
747 | 752 |
| |
748 | 753 |
| |
749 |
| - | |
750 |
| - | |
751 |
| - | |
752 |
| - | |
753 |
| - | |
754 |
| - | |
755 |
| - | |
756 | 754 |
| |
757 | 755 |
| |
758 | 756 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
104 |
| - | |
105 | 104 |
| |
106 | 105 |
| |
107 | 106 |
| |
|
0 commit comments
Comments
(0)