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

Audit field ordering test coverage and create new jscore test if necessary

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication

      In SERVER-30470, we discovered a bug where field ordering was not preserved when a specific series of oplog entries are applied. Although that bug was resolved after SERVER-50300, we should audit our tests to see if we have field ordering test coverage, and if not, we should create a new jscore test that covers this. The specific ordering of entries in SERVER-30470 that caused an issue was:

      Starting with a document { _id: 1, a: 0 };
      
      Apply: o: { $unset: { a: null } }
      ==> { _id: 1 };
      Apply: o: { $set: { 'a.c': 1, b: null } }
      ==> { _id: 1, a: { c: 1 }, b: null };
      
      // Applying the updates again:
      Apply: o: { $unset: { a: null } }
      ==> { _id: 1, b: null };
      Apply: o: { $set: { 'a.c': 1, b: null } }
      ==> { _id: 1, b: null, a: { c: 1 } };
      

      This came out of a discussion for mongosync regarding field ordering test coverage

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            xuerui.fa@mongodb.com Xuerui Fa
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: