<!-- llms-explorer concept facts · https://llms-explorer.com/tree/terminatesecondaryreadsonorphancleanup-and-queryplankilled-175/ · pack 2026-10-31 · ~1197 tokens -->

# terminateSecondaryReadsOnOrphanCleanup and QueryPlanKilled 175

> Source-anchored research for terminateSecondaryReadsOnOrphanCleanup and QueryPlanKilled 175. Run status: COMPLETED.

Parent: [Long-running secondary reads in sharded clusters](https://llms-explorer.com/tree/long-running-secondary-reads-in-sharded-clusters/) · 4 facets · 13 facts · page: https://llms-explorer.com/tree/terminatesecondaryreadsonorphancleanup-and-queryplankilled-175/

## How it works

- Code 175 alone does not identify orphan cleanup. Inspect errmsg before choosing cleanup-specific handling: Huawei DDS documents QueryPlanKilled 175 from hideIndex and dropIndex, with messages about index definition changes or a dropped index, and MongoDB explicitly warns that 175 has other causes. (high confidence) — [source](https://www.mongodb.com/docs/manual/core/long-running-secondary-reads.md)
- MongoDB documents db.serverStatus().metrics.operation.killedDueToRangeDeletion on secondary nodes and mongod log ID 10016300 with the cleanup termination message as monitoring signals for this specific termination cause. (low confidence) — [source](https://www.mongodb.com/docs/manual/core/long-running-secondary-reads.md)

## Problems, failure modes and limitations

- The parameter reference calls this termination error non-retryable by design. Applications must handle the interrupted read explicitly; do not assume automatic retry will continue the invalidated cursor. (low confidence) — [source](https://www.mongodb.com/docs/manual/reference/parameters.md)

## Comparisons and alternatives

- The parameter can be set at startup or runtime. It is a mongod server parameter with potentially different values on different mongod processes; verify each relevant process rather than assuming a single router setting configures the cluster. (medium confidence) — [source](https://www.mongodb.com/docs/manual/reference/parameters.md)
- The documented one-hour risk window reflects the default cleanup delay and migrations, rather than an unconditional one-hour query timeout. (medium confidence) — [source](https://www.mongodb.com/docs/v8.3/core/long-running-secondary-reads/)

## Facts and statements

- MongoDB documents terminateSecondaryReadsOnOrphanCleanup as new in 8.2, boolean, and true by default. It terminates secondary reads that began before migration commit before orphaned documents are removed from the secondary, preventing cleanup from silently removing documents from those reads. (medium confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/manual/core/long-running-secondary-reads.md)
- Setting terminateSecondaryReadsOnOrphanCleanup=false allows reads to continue through orphan cleanup, but reads against collections affected by migrations may silently omit documents. Avoid treating this setting as a correctness-preserving fix for killed analytics reads. (medium confidence) — [source](https://www.mongodb.com/docs/manual/core/long-running-secondary-reads.md)
- The parameter documentation scopes termination to reads that started before migration commit and includes queries, aggregations, and operations spanning multiple namespaces. (low confidence) — [source](https://www.mongodb.com/docs/manual/reference/parameters.md)
- Orphan-cleanup termination returns QueryPlanKilled, numeric code 175, classified as CursorInvalidatedError. The documented errmsg is "Read has been terminated due to orphan range cleanup". (high confidence) — [source](https://www.mongodb.com/docs/manual/core/long-running-secondary-reads.md)
- MongoDB 8.2 documentation increases the default orphanCleanupDelaySecs from 900 to 3600 seconds. The one-hour value is a cleanup delay, not a universal query execution timeout: the relevant read must overlap migration and cleanup. (medium confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/manual/core/long-running-secondary-reads.md)
- MongoDB introduced terminateSecondaryReadsOnOrphanCleanup in 8.2 with default true. Percona separately documents it as enabled by default in its own 8.3 technical preview. (high confidence) (verified as of 2026-10-30) — [source](https://www.mongodb.com/docs/v8.3/core/long-running-secondary-reads/)
- With the safeguard enabled, secondary reads begun before chunk migration commit can be terminated before the secondary removes orphaned documents. This prevents silent omission of migrated documents. (high confidence) — [source](https://www.mongodb.com/docs/manual/reference/parameters.md)
- The parameter can be set at startup or runtime. Setting it to false permits reads to continue through cleanup and may silently omit documents, matching the behavior before MongoDB 8.2. (high confidence) — [source](https://www.mongodb.com/docs/v8.3/core/long-running-secondary-reads/)
