[SERVER-44235] add redacted oplog entries to _logOpsInner() uassert message Created: 24/Oct/19  Updated: 29/Oct/23  Resolved: 05/Nov/19

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

Type: Improvement Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-11-04, Execution Team 2019-11-18
Participants:

 Description   

When the logOp() function fails to write an oplog entry because of restrictions in the current replication state, the error message looks like this:

logOp() but can't accept write to collection mydb.mycoll

It would be helpful, especially when debugging features that write multiple oplog entries at various points in the same component, to add some information on the oplog entries that logOp() failed to write to the local.oplog.rs collection. A proposed extension to the error message could look like the following:

logOp() but can't accept write to collection mydb.mycoll: [ (record id 1, redacted BSONObj doc 1),(record id 2, redacted BSONObj doc 2), ... ]

When the logOp() exception is logged as part of a longer error message, a sample message could like this:

Fatal assertion 51101 NotMaster: Index build: 7a6dae45-6bcf-474d-9868-27c6d0ca67a4; Database: unittests :: caused by :: logOp() but can't accept write to collection unittests.$cmd: entries: 1: [(RecordId(0), { op: "c", ns: "unittests.$cmd", ui: UUID("743fcd54-9c06-4fd2-9ab9-48c7b284ccd1"), o: { createIndexes: "InitialSyncSetIndexMultikeyOnInsert", v: 2, key: { b: 1 }, name: "b_1" }, ts: Timestamp(1, 93), t: 1, wall: new Date(1001), v: 2 })] at src/mongo/db/index_builds_coordinator.cpp 1159



 Comments   
Comment by Githook User [ 03/Nov/19 ]

Author:

{'name': 'Benety Goh', 'username': 'benety', 'email': 'benety@mongodb.com'}

Message: SERVER-44235 add oplog entries to _logOpsInner() uassert message
Branch: master
https://github.com/mongodb/mongo/commit/be045feaf3ba4af8037c5baceda2b15cd2498a24

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