Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-677

Duplicate logic in unified test runner for avoiding StaleDbVersion errors with distinct

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: Tests
    • Labels:

      Quoting Executing a Test:

      If the test might execute a distinct command within a sharded transaction, for each target collection the test runner SHOULD execute a non-transactional distinct command on each mongos server using the internal MongoClient. See StaleDbVersion Errors on Sharded Clusters for more information.

      This was already addressed via the UnifiedTestRunner::preventStaleDbVersionError() method in the original PR for PHPLIB-493. That method is called for each test and conditionally executes a distinct command as needed.

      It's unclear to me why a separate commit in the PR (added by andreas.braun after I handed things off) added what appears to be similar logic within the "distinct" operation case. See: https://github.com/mongodb/mongo-php-library/pull/783/commits/abc742618c43a5eff2961ded41d9293589f60518#diff-e1fc1998198af571cbeed186ed25b1c703850f87e91be5be15ebee8b674d29a0R311

      We should investigate whether the logic within the operation case is still required. Alternatively, if it is working around a failing of the preventStaleDbVersionError method we should try to fix that directly.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: