[SERVER-48967] Prevent replicated writes on empty namespaces on secondaries Created: 18/Jun/20  Updated: 29/Oct/23  Resolved: 10/Jul/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.0.20, 4.2.9, 4.4.1, 3.6.20, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Siyuan Zhou Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0, v3.6
Sprint: Repl 2020-07-13
Participants:
Linked BF Score: 30

 Description   

The writes on empty namespaces are exempt from this check and will be allowed even if the node has stepped down.



 Comments   
Comment by Githook User [ 10/Aug/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-48967 Ban non-primary writes with empty namespace

(cherry picked from commit 1ce0d13e46f720b35ae01e37d16bcd7b3789a045)
Branch: v4.4
https://github.com/mongodb/mongo/commit/17e5bae41f80d52d82345c3a038203c489aa8b69

Comment by Githook User [ 24/Jul/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-48967 Ban non-primary writes with empty namespace

(cherry picked from commit 1ce0d13e46f720b35ae01e37d16bcd7b3789a045)

  1. Conflicts:
  2. src/mongo/db/op_observer_impl_test.cpp
  3. src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
  4. src/mongo/db/repl/replication_coordinator_impl.cpp
    Branch: v3.6
    https://github.com/mongodb/mongo/commit/c57ab4974d550323c7f86d1de6cbc0499458138b
Comment by Githook User [ 24/Jul/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-48967 Ban non-primary writes with empty namespace

(cherry picked from commit 1ce0d13e46f720b35ae01e37d16bcd7b3789a045)
Branch: v4.0
https://github.com/mongodb/mongo/commit/7afdf1c0b501f5e9ff4a0621b3747bf25d7a5588

Comment by Githook User [ 23/Jul/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-48967 Ban non-primary writes with empty namespace

(cherry picked from commit 1ce0d13e46f720b35ae01e37d16bcd7b3789a045)
Branch: v4.2
https://github.com/mongodb/mongo/commit/9bffa938ea7e8a18ba0e5508f126f6e723d063a9

Comment by Githook User [ 09/Jul/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-48967 Ban non-primary writes with empty namespace
Branch: master
https://github.com/mongodb/mongo/commit/1ce0d13e46f720b35ae01e37d16bcd7b3789a045

Comment by Siyuan Zhou [ 02/Jul/20 ]

Wow. That's about 6 years ago! I thought it was for initiate, but not sure. I guess a patch build would prove or disprove that. Another way is to add an invariant in getOpObserver()->onOpMessage() to check writability is always true.

Comment by A. Jesse Jiryu Davis [ 01/Jul/20 ]

The special case for empty namespaces was introduced in SERVER-15645, I can't see why:

https://github.com/mongodb/mongo/commit/dd5b2d7f5cd96b4ca8acd01d15c5ac369c4f50f2#diff-c64a61c81bff3e9fbae542a82463b76dR295

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