You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments