Commit 59a21af
authored
REP-6826 Fix memory corruption from pool usage without cloning (#175)
PR #169 made document comparison use a memory pool. That changeset neglected to update uses of bson.Raw.Lookup(), which does not clone the field’s raw value. Thus, when a mismatched document was “put back” into memory, another thread overwrote a part of it.
Thus we got mismatch documents (i.e., in verifier metadata) where the same document ID showed up twice. This also, critically, made the verifier skip necessary rechecks because a later mismatch overwrote the buffer that contains the document ID meant for recheck.
This changeset fixes that problem by always cloning the document ID as part of reporting a mismatch. It also beefs up testing to ensure that the expected document IDs are reported in the log and in the rechecks.
This also makes the field-order-difference mismatch text more concise by removing a redundant document ID.1 parent 2325945 commit 59a21af
2 files changed
+40
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
| 724 | + | |
724 | 725 | | |
725 | 726 | | |
726 | 727 | | |
| 728 | + | |
| 729 | + | |
727 | 730 | | |
728 | 731 | | |
729 | 732 | | |
730 | | - | |
| 733 | + | |
731 | 734 | | |
732 | 735 | | |
733 | 736 | | |
| |||
746 | 749 | | |
747 | 750 | | |
748 | 751 | | |
749 | | - | |
750 | | - | |
| 752 | + | |
| 753 | + | |
751 | 754 | | |
752 | 755 | | |
753 | 756 | | |
754 | 757 | | |
755 | 758 | | |
756 | | - | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
757 | 762 | | |
758 | 763 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
1739 | 1740 | | |
1740 | 1741 | | |
1741 | 1742 | | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
1742 | 1751 | | |
1743 | 1752 | | |
1744 | 1753 | | |
| |||
1751 | 1760 | | |
1752 | 1761 | | |
1753 | 1762 | | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
1754 | 1769 | | |
1755 | 1770 | | |
1756 | 1771 | | |
| |||
1762 | 1777 | | |
1763 | 1778 | | |
1764 | 1779 | | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
1765 | 1796 | | |
1766 | 1797 | | |
1767 | 1798 | | |
| |||
0 commit comments