Skip to content

TOOLS-4309 Fail with a specific error on the upgradeDowngradeViewlessTimeseries oplog entry - #1094

Open
mattb-mdb wants to merge 1 commit into
masterfrom
TOOLS-4309-viewless-timeseries-oplog
Open

TOOLS-4309 Fail with a specific error on the upgradeDowngradeViewlessTimeseries oplog entry#1094
mattb-mdb wants to merge 1 commit into
masterfrom
TOOLS-4309-viewless-timeseries-oplog

Conversation

@mattb-mdb

Copy link
Copy Markdown
Collaborator

SERVER-114505 adds an oplog-only upgradeDowngradeViewlessTimeseries command, emitted during setFCV transitions across 8.x ↔ 9.0 to convert timeseries collections between their viewful and viewless forms. Because knownCommands is a closed allowlist, mongorestore --oplogReplay aborted on it with a generic unknown oplog command name error.

Changes
mongorestore/oplog.go — intercept the command ahead of the allowlist check and fail with a diagnostic that names the conversion, gives the timestamp, and points at --oplogLimit.

The entry is deliberately neither applied nor skipped. Allowlisting it would trip a server-side assertion (filterUUIDs strips ui unless --preserveUUID is set, and the handler asserts the UUID is present); ignoring it would leave the collection in a form that doesn't match the namespaces used by later oplog entries. Refusing the replay is the correct outcome.

Tests
TestOplogRestoreViewlessTimeseriesConversion (mongorestore/oplog_test.go) — builds a synthetic oplog with an insert followed by the conversion entry, in both the upgrade and downgrade (skipViewCreation) forms, and asserts the specific error. Also asserts the pre-conversion insert was applied, proving replay stops at the conversion. Synthetic, so it runs on any server version.

TestTimeseriesDumpConcurrentWithSetFCV (mongodump/mongodump_test.go) — resolves an open question from the investigation: a mongodump that overlaps a setFCV. Blocks the dump's getMore with the failCommand failpoint, runs setFCV 9.0 → 8.0 underneath it, and asserts the dump either contains every measurement or fails outright — never a silent truncation. Against 9.0.0-rc0 the server aborts the read with InterruptedDueToTimeseriesUpgradeDowngrade, so this is a hard error rather than data loss, and needs no tools-side change. Requires enableTestCommands=1 (CI has it); skips below 9.0 / FCV 9.0.

…Timeseries oplog entry

SERVER-114505 adds an oplog-only upgradeDowngradeViewlessTimeseries command, emitted
during setFCV transitions across 8.x <-> 9.0 to convert timeseries collections between
their viewful and viewless forms. Because knownCommands is a closed allowlist,
mongorestore --oplogReplay aborted on it with a generic "unknown oplog command name"
error.

Neither one-line mitigation is correct. Allowlisting the entry lets it fall through to
ApplyOp, but filterUUIDs strips ui unless --preserveUUID is set and the server handler
tripwire-asserts that the UUID is present. Ignoring the entry skips the conversion,
leaving the collection in a form that does not match the namespaces used by the oplog
entries after it.

Instead, intercept the command before the allowlist check and fail with a diagnostic
naming the conversion and pointing at --oplogLimit.

Also adds TestTimeseriesDumpConcurrentWithSetFCV, which resolves an open question from
the investigation: a mongodump whose read is interrupted by the conversion fails with
the server's InterruptedDueToTimeseriesUpgradeDowngrade error rather than silently
producing a truncated dump.
@mattb-mdb
mattb-mdb requested a review from a team as a code owner August 7, 2026 13:06
@mattb-mdb
mattb-mdb requested review from tdq45gj and removed request for a team August 7, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant