Don't include queryShapeHash for mongos for batched updates

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      if we have an update query with

      updates: [
      {q: {v: {$in: [1, 5]}}, u: {$set: {batch1: true}}, multi: true}, //Q1 
      {q: {v: {$in: [2, 6]}}, u: {$inc: {counter: 1}}, multi: true}, //Q2 
      {q: {v: {$in: [3, 7]}}, u: {$set: {batch3: "test"}}, multi: true}//Q3],

      there will only be one mongos slow query log with queryShapeHash: hash(Q1) There will be three mongod slow query logs, one with hash(Q1), one with hash(Q2), and one with hash(Q3).

      This doesn't make much sense for the mongos slow query log since the hash only corresponds with the first update, and not the overall request. This ticket is created to encapsulate this scenario and we should figure out what we would like to do. 

      1. We can remove the queryShapeHash from mongos slow query logs for updates. We would still be able to match slow query updates on mongod to the correct query stats metrics. We could also include some other metadata like nUpdateOps
      2. Append all queryShapeHashes i.e. (queryShapeHash: [hash(Q1), hash(Q2)... , hash(QN)]. This isn't ideal because we could have many requests in the update and would bloat the slow query logs.
      3. Combine the hashes in some fashion for mongos
      4. We can have some sort of identifier for the query and propogate it to mongod like originalQueryShapeHash for find/agg. Using the first queryShapeHash is an option, but doesn't make much sense as an identifier since its the first query

      Another question is if we would want to include the queryShapeHash on mongos if there is only one update.

            Assignee:
            Erin Zhu
            Reporter:
            Erin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: