-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
ALL
-
QE 2026-11-09, QE 2026-11-23
-
None
-
None
-
None
-
None
-
None
-
None
-
None
After SERVER-92779, a batched TTL delete on a secondary index resumes from the index key of the last staged document. If an attempt stages only entries equal to that key and deletes none of them, the next attempt starts after the key, because SortedDataInterface::Cursor cannot seek to a (key, RecordId) position. Owned expired documents that share that exact key and sort after the first ttlIndexDeleteTargetDocs unowned documents by RecordId are skipped for the rest of the pass. Every pass repeats this until the unowned documents are removed.
No document is deleted incorrectly; the affected documents are deleted late. Documents with other keys are deleted normally, and TTL passes complete.
Repro: 2 shards, range deleter disabled, ttlIndexDeleteTargetDocs: 100 on the donor. Insert 500 documents with t: Date(5000) that become orphans after a moveChunk, and 10 owned documents with t: Date(5000) inserted after them. The 10 owned documents remain after several TTL passes. The last case in jstests/sharding/ttl_resume_past_unowned_documents.js asserts this behavior and has a TODO for this ticket.
Options:
- In BatchedDeleteStage, skip without counting toward targetPassDocs the entries at the resume key whose RecordId is <= the last staged RecordId. Costs re-fetching those entries on every attempt.
- Add a (key, RecordId) seek to the sorted data cursor and a start position to IndexScan.
- related to
-
SERVER-92779 TTL delete progress blocked by unowned documents
-
- Closed
-