Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-60788

merge_causes_infinite_loop.js attempts to expose a problem that no longer exists

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0, 5.1.2, 5.0.6, 4.4.11
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • v5.1, v5.0, v4.4
    • QE 2021-11-15, QE 2021-11-29, QE 2021-12-13

      In merge_causes_infinite_loop.js, we attempt to expose the Halloween problem with a $merge pipeline that writes to the same collection that is aggregated. The test assumes that this will cause documents to be updated and pushed forward indefinitely, which will cause the computed values to eventually overflow. As such, after writing to the same collection that is aggregated, the test used to have this assertion that it fails with an overflow error.

      The error code in the assertion corresponds to this uassert, which $multiply will no longer trip as a result of SERVER-60588's changes to the implementation. Therefore, I removed the assertion as a part of that ticket, to avoid failures of this test.

      In the process, I realized that this assertion has been succeeding not because there was an infinite loop, as the test assumes, but simply because the starting value of $a was high enough to trip an overflow even when only updating once, as expected. Moreover, I realized that even when writing to the same collection that is being aggregated, each document's value of $a was updated only once. Therefore, the Halloween problem does not actually exist for $merge at the moment.

      We need to re-evaluate whether we still need this test, and what exactly we want it to be searching for.

            Assignee:
            mihai.andrei@mongodb.com Mihai Andrei
            Reporter:
            jennifer.peshansky@mongodb.com Jennifer Peshansky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: