[SERVER-27096] applyOps should validate its ops to ensure idempotency Created: 17/Nov/16  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Judah Schvimer Assignee: Backlog - Replication Team
Resolution: Unresolved Votes: 0
Labels: applyOps, idempotency, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-32941 applyOps command inserts documents wi... Backlog
related to SERVER-32952 applyOps does not validate updates Backlog
related to SERVER-28200 Recoverable Rollback: Extend dropInde... Closed
related to SERVER-28205 Recoverable Rollback: Extend TTL-rela... Closed
related to SERVER-32342 Make doTxn rewrite non-idempotent wri... Closed
is related to SERVER-32305 Able to create document with array as... Backlog
is related to SERVER-27092 blacklist apply_ops1.js from dynamic ... Closed
is related to SERVER-28897 Update apply_ops1.js to only perform ... Closed
Assigned Teams:
Replication
Participants:
Linked BF Score: 0

 Description   

applyOps commands can include things like $inc operators that make them non-idempotent. Since applyOps entries get put in the oplog unchanged, non-idempotent applyOps commands can lead to non-idempotent oplog entries which is problematic. We do not create any bad applyOps entries internally, but external ones are allowed. We should check applyOps commands before running them and error on non-idempotent operations.



 Comments   
Comment by Matthew Russotto [ 09/Feb/18 ]

The doTxn changes don't affect (non-atomic) applyOps. I don't think it would be too difficult but it would result in the oplog entry not being stored exactly as given.

Comment by Spencer Brody (Inactive) [ 14/Dec/17 ]

The change to doTxn in SERVER-32342 may also wind up happening for applyOps for free, which would eliminate the need for this work.

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