Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57857

Impossible to change the sync source for the mongod

    • Type: Icon: Question Question
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Repl 2021-07-26

      Hi,

      I want to change sync source for the mongod on core-storage106-dc2.example.com:

      rs.syncFrom('core-storage104-dc2.example.com:27018');

       

      And an error is given:

      {"t":{"$date":"2021-06-21T10:13:44.762+03:00"},"s":"I", "c":"REPL", "id":21829, "ctx":"ReplCoordExtern-1","msg":"Choosing new sync source because the user has requested a sync source","attr":{"syncSource":"core-storage104-dc2.example.com:27018"}}
      {"t":{"$date":"2021-06-21T10:13:44.762+03:00"},"s":"I", "c":"REPL", "id":21150, "ctx":"ReplCoordExtern-1","msg":"Canceling oplog query due to OplogQueryMetadata. We have to choose a new sync source","attr":{"syncSource":"core-storage101.example.com:27017","lastAppliedOpTime":{"ts":{"$timestamp":{"t":1624259624,"i":1}},"t":18},"syncSourceIndex":-1}}
      {"t":{"$date":"2021-06-21T10:13:44.763+03:00"},"s":"W", "c":"REPL", "id":21122, "ctx":"BackgroundSync","msg":"Fetcher stopped querying remote oplog with error","attr":{"error":"InvalidSyncSource: sync source core-storage101.example.com:27017 (config version: 19; last applied optime: { ts: Timestamp(1624259624, 1), t: 18 }; sync source index: -1; primary index: 0) is no longer valid"}}
      {"t":{"$date":"2021-06-21T10:13:44.765+03:00"},"s":"I", "c":"REPL", "id":21080, "ctx":"BackgroundSync","msg":"Clearing sync source to choose a new one","attr":{"syncSource":"core-storage101.example.com:27017"}}
      {"t":{"$date":"2021-06-21T10:13:44.765+03:00"},"s":"I", "c":"REPL", "id":21782, "ctx":"BackgroundSync","msg":"Choosing sync source candidate by request","attr":{"syncSource":"core-storage104-dc2.example.com:27018"}}
      {"t":{"$date":"2021-06-21T10:13:44.765+03:00"},"s":"I", "c":"REPL", "id":21760, "ctx":"SyncSourceFeedback","msg":"SyncSourceFeedback error sending update","attr":{"syncTarget":"core-storage101.example.com:27017","error":{"code":119,"codeName":"InvalidSyncSource","errmsg":"Sync source was cleared. Was core-storage101.example.com:27017"}}}
      {"t":{"$date":"2021-06-21T10:13:44.766+03:00"},"s":"I", "c":"CONNPOOL", "id":22576, "ctx":"ReplCoordExternNetwork","msg":"Connecting","attr":{"hostAndPort":"core-storage104-dc2.example.com:27018"}}
      {"t":{"$date":"2021-06-21T10:13:44.772+03:00"},"s":"I", "c":"REPL", "id":21088, "ctx":"BackgroundSync","msg":"Changed sync source","attr":{"oldSyncSource":"core-storage101.example.com:27017","newSyncSource":"core-storage104-dc2.example.com:27018"}}
      {"t":{"$date":"2021-06-21T10:13:44.778+03:00"},"s":"W", "c":"REPL", "id":21122, "ctx":"BackgroundSync","msg":"Fetcher stopped querying remote oplog with error","attr":{"error":"InvalidSyncSource: Sync source must be ahead of me. My last fetched oplog optime: { ts: Timestamp(1624259624, 1), t: 18 }, latest oplog optime of sync source: { ts: Timestamp(1624259624, 1), t: 18 }"}}
      {"t":{"$date":"2021-06-21T10:13:44.778+03:00"},"s":"I", "c":"REPL", "id":21080, "ctx":"BackgroundSync","msg":"Clearing sync source to choose a new one","attr":{"syncSource":"core-storage104-dc2.example.com:27018"}}
      {"t":{"$date":"2021-06-21T10:13:44.778+03:00"},"s":"I", "c":"REPL", "id":21798, "ctx":"BackgroundSync","msg":"Could not find member to sync from"}
      {"t":{"$date":"2021-06-21T10:13:45.779+03:00"},"s":"I", "c":"NETWORK", "id":22944, "ctx":"conn259","msg":"Connection ended","attr":{"remote":"127.0.0.1:44031","connectionId":259,"connectionCount":6}}
      {"t":{"$date":"2021-06-21T10:13:49.775+03:00"},"s":"I", "c":"REPL", "id":21760, "ctx":"SyncSourceFeedback","msg":"SyncSourceFeedback error sending update","attr":{"syncTarget":"core-storage104-dc2.example.com:27018","error":{"code":119,"codeName":"InvalidSyncSource","errmsg":"Sync source was cleared. Was core-storage104-dc2.example.com:27018"}}}
      {"t":{"$date":"2021-06-21T10:13:55.785+03:00"},"s":"I", "c":"REPL", "id":21799, "ctx":"BackgroundSync","msg":"Sync source candidate chosen","attr":{"syncSource":"core-storage102.example.com:27017"}}
      {"t":{"$date":"2021-06-21T10:13:55.785+03:00"},"s":"I", "c":"CONNPOOL", "id":22576, "ctx":"ReplCoordExternNetwork","msg":"Connecting","attr":{"hostAndPort":"core-storage102.example.com:27017"}}
      {"t":{"$date":"2021-06-21T10:13:55.940+03:00"},"s":"I", "c":"REPL", "id":21088, "ctx":"BackgroundSync","msg":"Changed sync source","attr":{"oldSyncSource":"empty","newSyncSource":"core-storage102.example.com:27017"}}
      

      Why is it getting an error?

      "InvalidSyncSource: Sync source must be ahead of me. My last fetched oplog optime: { ts: Timestamp(1624259624, 1), t: 18 }, latest oplog optime of sync source: { ts: Timestamp(1624259624, 1), t: 18 }"
      

      How can I change sync source if the replicas have the same oplog optime?

            Assignee:
            xuerui.fa@mongodb.com Xuerui Fa
            Reporter:
            kkrasnov@gmail.com Konstantin Krasnov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: