[SERVER-52955] KeysCollectionClientDirect should check if majority read concern is supported by storage engine Created: 20/Nov/20  Updated: 29/Oct/23  Resolved: 23/Nov/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 4.0.11
Fix Version/s: 4.0.22

Type: Bug Priority: Major - P3
Reporter: Alexander Taskov (Inactive) Assignee: Alexander Taskov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by SERVER-40535 Possibility to get a non-existent key... Closed
Related
related to SERVER-56937 upgradeSet() in multi_rs.js may lose ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2020-11-30
Participants:

 Description   
Issue Status as of Dec 16, 2020

ISSUE DESCRIPTION AND IMPACT

When running the deprecated MMAPv1 storage engine in a replica set, attempts for mongod to refresh its set of signing keys from local storage silently fail. This prevents the mongod from signing new cluster times and validating the signatures of existing cluster times.

  • Being unable to sign new cluster times prevents causal consistency from being used by clients.
  • Being unable to validate the signatures of existing cluster times causes all client requests to be rejected with an error.

DIAGNOSIS AND AFFECTED VERSIONS

This affects versions of 4.0 starting from 4.0.11 through 4.0.21 inclusive, which are running with the deprecated MMAPv1 storage engine (using the --storageEngine mmapv1 startup option). Operations run on the cluster will fail with a "No Keys Found" errmsg. For example:

> db.runCommand({isMaster: 1})
{
    "ok" : 0,
    "errmsg" : "Cache Reader No keys found for HMAC that is valid for time: { ts: Timestamp(1606144194, 9) } with id: 6898336773005377537",
    "code" : 211,
    "codeName" : "KeyNotFound"
}

REMEDIATION AND WORKAROUNDS

A fix is included in the 4.0.22 production release.

Affected users unable to upgrade or switch to the WiredTiger storage engine can start mongod with --enableMajorityReadConcern=false as a workaround.

This command line option normally has no effect for the MMAPv1 storage engine. But it does avoid the bug in affected versions, allowing mongod to successfully refresh its set of signing keys from local storage.

Original Description

Currently, this code checks if majority read concern is enabled by the server parameter. It should instead check that the storage engine supports it. In the current state, causal consistency will not work with the mmapv1 storage engine as the server will not return operationTime and $clusterTime.



 Comments   
Comment by Githook User [ 15/May/21 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-53029 Port the changes for SERVER-52955 to later branches

(cherry picked from commit 554fab0be3f1699a68201e70eb9fd1a42d78ca1f)
Branch: v4.2
https://github.com/mongodb/mongo/commit/7a78bd358e2b23ce9570b56ce3e82d19b4e93c85

Comment by Githook User [ 14/Dec/20 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-53029 Port the changes for SERVER-52955 to later branches
Branch: v4.4
https://github.com/mongodb/mongo/commit/913d6b62acfbb344dde1b116f4161360acd8fd13

Comment by Githook User [ 26/Nov/20 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-53029 Port the changes for SERVER-52955 to later branches
Branch: master
https://github.com/mongodb/mongo/commit/554fab0be3f1699a68201e70eb9fd1a42d78ca1f

Comment by Githook User [ 21/Nov/20 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-52955 KeysCollectionClientDirect should check if majority read concern is supported by storage engine
Branch: v4.0
https://github.com/mongodb/mongo/commit/58c8bb3b1b1e72d42b7ad2bb203e63271745401c

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