-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
Fully Compatible
-
Storage Execution 2026-10-26, Storage Execution 2026-11-09
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When a worker applies an oplog entry that turns an index multikey, the catalog write is deferred until just before the batch is completed. It must commit at the earliest timestamp that index became multikey in the batch, strictly below the stable timestamp, before lastApplied advances past the batch.
This ticket adds the per-batch multikey accumulator to the POA component, and flushes the multikey writes in the advancer before publishing lastApplied. Multikey path tracking on workers threads are not implemented here, and turning that tracking on is in a follow-up ticket.
This ticket should include:
- A BatchMultikey accumulator type shared by all work items of one dispatch batch and referenced by the batch's in-flight entry. The dispatcher creates one per batch and attaches it to each WorkItem and the InflightBatch.
- The flush: when the advancer pops a completed batch, merge that batch's accumulated multikey into the accumulator and write each index's multikey flag at its earliestTimestamp, before publishing lastApplied past the batch. This ensures every earliestTimestamp in a just-popped batch is > lastApplied so the catalog writes commit for the multikey writes are above stable timestamp.
- The inline-path call site: inline-applied ops' multikey flushes before the inline batch publishes (same flush function).
Tests: the flush/merge logic commits each index at the earliest recorded timestamp; out-of-order timestamps keep the earliest per index; earliestTimestamp > stable; flush completes before lastApplied publishes past the batch; an empty accumulator is a no-op.