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

Do oplog version check in OplogFetcher instead of OplogBatcher

    • Replication
    • Fully Compatible
    • Repl 2024-02-19

      Move oplog version check logic from OplogBatcher to OplogFetcher during document validation.

      We should probably feature flag gate this since doing in OplogFetcher would need to parse the version from the oplog BSONObject which cause some overhead, while in OplogBatcher the entire oplog entry is already parsed so getting the version is trivial.

      Since we will have an OplogWriter in front of OplogApplier, we should do the version check early - that is, before we write to the oplog - but we want the OplogWriter to be efficient (i.e. we don’t want to iterate through the oplog entries in the batch and parse the version). Therefore, we can check the version in the OplogFetcher where we already iterate and parse the OpTime field for validation.

      AC: The OplogFetcher validates the version, and neither the OplogWriter nor the OplogApplier check the version.

            Assignee:
            brad.cater@mongodb.com Brad Cater
            Reporter:
            wenbin.zhu@mongodb.com Wenbin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: