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

appliedThrough document write and background validation reads could use the same timestamp

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • ALL

      Background validation reads at the all_durable timestamp. My understanding is that on secondaries, the all_durable timestamp can advance before a batch application completes, i.e. being ahead of the lastApplied timestamp.

      It is possible for the oplog applier to write (commit) the appliedThrough document using the timestamp of the last oplog entry in the batch while the background validation is reading at the all_durable which could be the same as the timestamp used in the appliedThrough write.

      Actually, collection validations take the PBWM lock and should conflict with oplog application. But unfortunately, by the time we write the appliedThrough, we already release the PBWM lock (which is only held in _applyOplogBatch). So background validation can start reading from all_durable which would be the timestamp of the last oplog entry in the batch by then while the oplog applier thread is trying to write using that same timestamp. And this violates WT's assertion that commit timestamp is newer than all readers. This assertion is currently disabled.

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: