[SERVER-33557] Improve error message when users try to write to oplog before stable timestamp Created: 28/Feb/18  Updated: 06/Dec/22  Resolved: 29/Mar/18

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

Type: Task Priority: Major - P3
Reporter: Judah Schvimer Assignee: Backlog - Replication Team
Resolution: Won't Fix Votes: 0
Labels: rollback-optional
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Participants:

 Description   

Due to timestamping, it's not safe to write to the oplog with an entry ts field before the stable timestamp and WT will crash with the following. This is not obvious to the user what is wrong:

[js_test:oplog_replay_on_startup] 2018-02-26T03:34:10.704+0000 d23260| 2018-02-26T03:34:10.703+0000 E STORAGE  [conn1] WiredTiger error (22) [1519616050:703015][79182:0x7f11d0adb700], WT_SESSION.timestamp_transaction: commit timestamp 3E800000001 older than stable timestamp 5a93803000000004: Invalid argument
[js_test:oplog_replay_on_startup] 2018-02-26T03:34:10.706+0000 d23260| 2018-02-26T03:34:10.703+0000 F -        [conn1] Fatal assertion 39001 BadValue: timestamp_transaction 22: Invalid argument at src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp 1157



 Comments   
Comment by Eric Milkie [ 01/Mar/18 ]

That test appears to write to the oplog in standalone mode, so there is no stable timestamp.

Comment by Judah Schvimer [ 28/Feb/18 ]

We have a test that does it. https://github.com/mongodb/mongo/blob/1e89f1ba964d1989dfef74e189926d47a5c930c9/jstests/replsets/oplog_replay_on_startup.js#L58-L67

Comment by Eric Milkie [ 28/Feb/18 ]

How are users writing to the oplog with user-specified ts fields?

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