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

"metrics" field in resharding's donor, recipient, and coordinator documents isn't marked as optional

    • Fully Compatible
    • ALL
    • v5.0
    • Sharding 2021-07-12
    • 1

      The changes from SERVER-57266 are an on-disk format change to resharding's donor, recipient, and coordinator documents and won't be present in MongoDB 5.0.0. It must be possible for a user to upgrade from binVersion 5.0 to 5.1 while keeping their featureCompatibilityVersion as 5.0 and continue to run an ongoing resharding operation. Therefore, binVersion 5.1 must be prepared for the metrics field to not be present in the resharding's donor, recipient, and coordinator documents.

      The current behavior causes binVersion 5.1 secondaries (in FCV 5.0) to crash when receiving an update oplog entry from a binVersion 5.0 primary because the DonorStateEnum::kDonatingInitialData state transition causes secondaries to attempt to parse the updated donor state document to pin the oldest_timestamp in WiredTiger.

      [js_test:resharding_clones_initial_data] d21023| 2021-07-02T22:30:09.680+00:00 F  REPL     21235   [OplogApplier-0] "Failed to apply batch of operations","attr":{"numOperationsInBatch":1,"firstOperation":{"oplogEntry":{"op":"u","ns":"config.localReshardingOperations.donor","ui":{"$uuid":"60221813-d9de-489b-8969-d8e3357d9906"},"o":{"$v":2,"diff":{"u":{"mutableState":{"state":"donating-initial-data","minFetchTimestamp":{"$timestamp":{"t":1625265009,"i":94}},"bytesToClone":124,"documentsToClone":2}}}},"o2":{"_id":{"$uuid":"effff212-ee94-4dfa-a97c-5ebc55aafb9a"}},"ts":{"$timestamp":{"t":1625265009,"i":95}},"t":1,"v":2,"wall":{"$date":"2021-07-02T22:30:09.633Z"}}},"lastOperation":{"oplogEntry":{"op":"u","ns":"config.localReshardingOperations.donor","ui":{"$uuid":"60221813-d9de-489b-8969-d8e3357d9906"},"o":{"$v":2,"diff":{"u":{"mutableState":{"state":"donating-initial-data","minFetchTimestamp":{"$timestamp":{"t":1625265009,"i":94}},"bytesToClone":124,"documentsToClone":2}}}},"o2":{"_id":{"$uuid":"effff212-ee94-4dfa-a97c-5ebc55aafb9a"}},"ts":{"$timestamp":{"t":1625265009,"i":95}},"t":1,"v":2,"wall":{"$date":"2021-07-02T22:30:09.633Z"}}},"failedWriterThread":5,"error":"Location40414: BSON field 'Resharding.metrics' is missing but a required field"}
      [js_test:resharding_clones_initial_data] d21023| 2021-07-02T22:30:09.681+00:00 F  -        23095   [OplogApplier-0] "Fatal assertion","attr":{"msgid":34437,"error":"Location40414: BSON field 'Resharding.metrics' is missing but a required field","file":"src/mongo/db/repl/oplog_applier_impl.cpp","line":343}
      

      https://logkeeper.mongodb.org/lobster/build/cab833f009ab645d4fc6883086634421/test/60df9363f84ae874d8b949d3#bookmarks=0%2C2122%2C2123%2C5914&f~=100~buildInfo

            Assignee:
            janna.golden@mongodb.com Janna Golden
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: