Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14796

[SERVER] `compact` documentation mentions that the compact command is not replicated to secondaries. logs show otherwise

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Cannot Reproduce
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual, Server
    • None

    Description

      when running a compact command on primary, i saw on the secondary’s mongod.log references to the compact command.

      which indicates that the statement in documentation about “compact commands do not replicate to secondaries in a replica set” might be incorrect
      :

      {"t":\{"$date":"2021-08-11T16:39:31.916+03:00"}

      ,"s":"I", "c":"REPL", "id":21350, "ctx":"conn24","msg":"Going into maintenance mode","attr":{"otherMaintenanceModeTasksInProgress":0}}
      {"t":

      {"$date":"2021-08-11T16:39:31.916+03:00"}

      ,"s":"I", "c":"REPL", "id":21358, "ctx":"conn24","msg":"Replica set state transition","attr":{"newState":"RECOVERING","oldState":"SECONDARY"}}
      {"t":

      {"$date":"2021-08-11T16:39:31.916+03:00"}

      ,"s":"I", "c":"REPL", "id":21106, "ctx":"conn24","msg":"Resetting sync source to empty","attr":{"previousSyncSource":"localhost:27019"}}
      {"t":

      {"$date":"2021-08-11T16:39:31.916+03:00"}

      ,"s":"I", "c":"COMMAND", "id":20284, "ctx":"conn24","msg":"Compact begin","attr":{"namespace":"test.dror"}}
      {"t":

      {"$date":"2021-08-11T16:39:31.916+03:00"}

      ,"s":"I", "c":"NETWORK", "id":4333213, "ctx":"ReplicaSetMonitor-TaskExecutor","msg":"RSM Topology Change","attr":{"replicaSet":"replset","newTopologyDescription":"{ id: "89006e07-4f5e-4f3b-9caf-63dd23712cf3", topologyType: "ReplicaSetWithPrimary", servers: { localhost:27017: { address: "localhost:27017", topologyVersion:

      { processId: ObjectId('6113d117bb869a1f8d662918'), counter: 6 }

      , roundTripTime: 498, lastWriteDate: new Date(1628689159000), opTime: { ts: Timestamp(1628689159, 1), t: 1 }, type: "RSPrimary", minWireVersion: 9, maxWireVersion: 9, me: "localhost:27017", setName: "replset", setVersion: 1, electionId: ObjectId('7fffffff0000000000000001'), primary: "localhost:27017", lastUpdateTime: new Date(1628689166002), logicalSessionTimeoutMinutes: 30, hosts: { 0: "localhost:27017", 1: "localhost:27018", 2: "localhost:27019" }, arbiters: {}, passives: {} }, localhost:27018: { address: "localhost:27018", topologyVersion:

      { processId: ObjectId('6113d11869dec405deadef04'), counter: 9 }

      , roundTripTime: 506, lastWriteDate: new Date(1628689169000), opTime: { ts: Timestamp(1628689169, 1), t: 1 }, type: "RSOther", minWireVersion: 9, maxWireVersion: 9, me: "localhost:27018", setName: "replset", setVersion: 1, primary: "localhost:27017", lastUpdateTime: new Date(1628689171916), logicalSessionTimeoutMinutes: 30, hosts: { 0: "localhost:27017", 1: "localhost:27018", 2: "localhost:27019" }, arbiters: {}, passives: {} }, localhost:27019: { address: "localhost:27019", topologyVersion:

      { processId: ObjectId('6113d119ff1f96dd88b5972e'), counter: 4 }

      , roundTripTime: 434, lastWriteDate: new Date(1628689159000), opTime: { ts: Timestamp(1628689159, 1), t: 1 }, type: "RSSecondary", minWireVersion: 9, maxWireVersion: 9, me: "localhost:27019", setName: "replset", setVersion: 1, primary: "localhost:27017", lastUpdateTime: new Date(1628689166002), logicalSessionTimeoutMinutes: 30, hosts: { 0: "localhost:27017", 1: "localhost:27018", 2: "localhost:27019" }, arbiters: {}, passives: {} } }, logicalSessionTimeoutMinutes: 30, setName: "replset", compatible: true, maxSetVersion: 1, maxElectionId: ObjectId('7fffffff0000000000000001') }","previousTopologyDescription":"{ id: "89006e07-4f5e-4f3b-9caf-63dd23712cf3", topologyType: "ReplicaSetWithPrimary", servers: { localhost:27017: { address: "localhost:27017", topologyVersion:

      { processId: ObjectId('6113d117bb869a1f8d662918'), counter: 6 }

      , roundTripTime: 498, lastWriteDate: new Date(1628689159000), opTime: { ts: Timestamp(1628689159, 1), t: 1 }, type: "RSPrimary", minWireVersion: 9, maxWireVersion: 9, me: "localhost:27017", setName: "replset", setVersion: 1, electionId: ObjectId('7fffffff0000000000000001'), primary: "localhost:27017", lastUpdateTime: new Date(1628689166002), logicalSessionTimeoutMinutes: 30, hosts: { 0: "localhost:27017", 1: "localhost:27018", 2: "localhost:27019" }, arbiters: {}, passives: {} }, localhost:27018: { address: "localhost:27018", topologyVersion:

      { processId: ObjectId('6113d11869dec405deadef04'), counter: 8 }

      , roundTripTime: 506, lastWriteDate: new Date(1628689169000), opTime: { ts: Timestamp(1628689169, 1), t: 1 }, type: "RSSecondary", minWireVersion: 9, maxWireVersion: 9, me: "localhost:27018", setName: "replset", setVersion: 1, primary: "localhost:27017", lastUpdateTime: new Date(1628689170770), logicalSessionTimeoutMinutes: 30, hosts: { 0: "localhost:27017", 1: "localhost:27018", 2: "localhost:27019" }, arbiters: {}, passives: {} }, localhost:27019: { address: "localhost:27019", topologyVersion:

      { processId: ObjectId('6113d119ff1f96dd88b5972e'), counter: 4 }

      , roundTripTime: 434, lastWriteDate: new Date(1628689159000), opTime: { ts: Timestamp(1628689159, 1), t: 1 }, type: "RSSecondary", minWireVersion: 9, maxWireVersion: 9, me: "localhost:27019", setName: "replset", setVersion: 1, primary: "localhost:27017", lastUpdateTime: new Date(1628689166002), logicalSessionTimeoutMinutes: 30, hosts: { 0: "localhost:27017", 1: "localhost:27018", 2: "localhost:27019" }, arbiters: {}, passives: {} } }, logicalSessionTimeoutMinutes: 30, setName: "replset", compatible: true, maxSetVersion: 1, maxElectionId: ObjectId('7fffffff0000000000000001') }"}}
      {"t":

      {"$date":"2021-08-11T16:39:31.923+03:00"}

      ,"s":"I", "c":"STORAGE", "id":22430, "ctx":"conn24","msg":"WiredTiger message","attr":{"message":"[1628689171:923129][47401:0x7000088e1000], WT_SESSION.compact: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 521, snapshot max: 521 snapshot count: 0, oldest timestamp: (1628689164, 1) , meta checkpoint timestamp: (1628689169, 1)"}}
      {"t":

      {"$date":"2021-08-11T16:39:32.639+03:00"}

      ,"s":"I", "c":"STORAGE", "id":22430, "ctx":"conn24","msg":"WiredTiger message","attr":{"message":"[1628689172:639682][47401:0x7000088e1000], WT_SESSION.compact: [WT_VERB_CHECKPOINT_PROGRESS] saving checkpoint snapshot min: 522, snapshot max: 522 snapshot count: 0, oldest timestamp: (1628689164, 1) , meta checkpoint timestamp: (1628689169, 1)"}}
      {"t":

      {"$date":"2021-08-11T16:39:33.094+03:00"}

      ,"s":"I", "c":"STORAGE", "id":20286, "ctx":"conn24*","msg":"Compact* end","attr":{"namespace":"test.dror","freedBytes":0}}
      {"t":

      {"$date":"2021-08-11T16:39:33.094+03:00"}

      ,"s":"I", "c":"REPL", "id":21351, "ctx":"conn24","msg":"Leaving maintenance mode","attr":{"otherMaintenanceModeTasksOngoing":0}}
      {"t":

      {"$date":"2021-08-11T16:39:33.094+03:00"}

      ,"s":"I", "c":"REPL", "id":21358, "ctx":"conn24","msg":"Replica set state transition","attr":{"newState":"SECONDARY","oldState":"RECOVERING"}}
      {"t":

      {"$date":"2021-08-11T16:39:33.094+03:00"}

      ,"s":"I", "c":"REPL", "id":21106, "ctx":"conn24","msg":"Resetting sync source to empty","attr":{"previousSyncSource":":27017"}}
      {"t":

      {"$date":"2021-08-11T16:39:33.094+03:00"}

      ,"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn24","msg":"Slow query","attr":{"type":"command","ns":"test.dror","appName":"MongoDB Shell","command":{"compact":"dror","lsid":{"id":{"$uuid":"6b13fabe-5b47-45e6-a808-037acb22cdb1"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1628689059,"i":1}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$readPreference":{"mode":"secondaryPreferred"},"$db":"test"},"numYields":0,"reslen":54,"locks":{"ParallelBatchWriterMode":{"acquireCount":{"r":1}},"ReplicationStateTransition":{"acquireCount":{"w":1}},"Global":{"acquireCount":{"w":1}},"Database":{"acquireCount":{"w":1}},"Collection":{"acquireCount":{"w":1,"W":1}},"Mutex":{"acquireCount":

      {"r":1}

      }},"flowControl":{"acquireCount":1},"storage":{"data":{"bytesWritten":131457,"timeWritingMicros":6465}},"protocol":"op_msg","durationMillis":1178}}

      Attachments

        Activity

          People

            Unassigned Unassigned
            dror.mikdash@mongodb.com Dror Mikdash (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              2 years, 26 weeks ago