[SERVER-58304] "metrics" field in resharding's donor, recipient, and coordinator documents isn't marked as optional Created: 06/Jul/21  Updated: 29/Oct/23  Resolved: 08/Jul/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.0.4, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: PM-234-M3, PM-234-T-autocommits
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-58355 Fix disabled Resharding tests failing... Closed
is depended on by SERVER-56366 Update FCV constants in server code b... Closed
Problem/Incident
is caused by SERVER-57266 Create IDL representations for reshar... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding 2021-07-12
Participants:
Story Points: 1

 Description   

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



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 06/Oct/21 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-58304 Make 'metrics' field in resharding documents optional

(cherry picked from commit 304ce7435a17740b88c29ddc8b6b08b8c0c4e292)
Branch: v5.0
https://github.com/mongodb/mongo/commit/d25f8528e7519d602218a10aadf54913d656fd05

Comment by Githook User [ 08/Jul/21 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-58304 Make 'metrics' field in resharding documents optional
Branch: master
https://github.com/mongodb/mongo/commit/304ce7435a17740b88c29ddc8b6b08b8c0c4e292

Generated at Thu Feb 08 05:44:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.