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

[CQF] Consolidate runWithParams and runWithParamsAllNodes

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Optimization

      runWithParams in optimizer_utils.js only works for standalone db passthrough tests (it references db, which is not a parameter). In SERVER-76509 the need for a similar function that works for all cases arose, hence the creation of runWithParamsAllNodes. It would be great if the two could be consolidated, since they basically do the same thing. However, there is an issue with that - runWithParamsAllNodes calls setParameterOnAllHosts, which creates a new Mongo. This ends up calling startSession(), which prints the sessionId + options. This is a problem for any golden JS test that could try to call this function since that print would appear in the golden output. Since the session id is different for each run of the test, such a golden JS test would always fail since it would differ from the expected output. 

      I was talking to david.percy@mongodb.com about this and he suggested an approach where we introduce a global variable that keeps track of whether we should actually print the output, add logic in golden_test.js and golden_overrides.js to add an override for setParameterOnAllHosts. This override would use set the global variable to disable printing for the function.

       

      This ticket tracks the work to implement the above and consolidate the two runWithParams functions.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            militsa.sotirova@mongodb.com Militsa Sotirova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: