Repository navigation
Fix/changestream early start lazy oplog - #727
Conversation
eerxuan
left a comment
There was a problem hiding this comment.
Summary
Reading the oldest oplog entry only in the one case that uses it is a clean fix: the three static cases no longer depend on a readable local.oplog.rs, and oldest_minus_5s is gated with the same per-case requires(oplog=True) the collMod oplog.rs cases use. Each test still makes one assertion. Only minor points below.
Suggestions
- [Suggestion]
preconditions.py: the profile changed in the second commit dropsoplogbut keepsreplication, andreplicationis described as "replication commands are available (applyOps, oplog access)". Please reword that description to cover only applyOps, so the two capabilities don't overlap. Otherwise the profile looks like it claims oplog access throughreplication.
Questions
- [Question] The description says the profile change wasn't run against a live server. It now skips three cases on that profile (
oldest_minus_5sand the two collModoplog.rscases). Can you confirm, from one run against that target, thatlocal.oplog.rsisn't readable there, so the skips don't drop coverage that used to pass? - [Nitpick] The branch is 3 commits behind main. Please rebase before merge.
Positive Feedback
- The
compute_startdocstring now says why the oplog is read lazily, so the next case author knows not to call it for a static start time.
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage, test-framework); effort from diff stats (17+13 LOC, 2 files); LLM: Fixes a premature oplog read in changestream tests that causes false failures on engines without local.oplog.rs, masking valid early-startAtOperationTime behavior; touches test files and profile config across one component. If a label is wrong, remove it manually and ping |
test_changeStream_early_start looked up the oldest oplog entry for every parametrized case, before running the change-stream command. Only oldest_minus_5s uses that value; zero, one_zero and max_increment use static start times. On a target with no readable oplog entry the lookup raises StopIteration, so those three cases never reach the server and record nothing about whether an early startAtOperationTime is accepted. Pass compute_start a callable that performs the lookup, so the oplog is read only by the case that uses it. Signed-off-by: Samar Farooqi <samafarc@amazon.com>
Amazon DocumentDB does not expose its replication log as local.oplog.rs: reading the oldest entry returns no document. The amazon-documentdb profile declared the oplog capability anyway, so oplog-dependent cases ran and failed in test code rather than being gated. Remove oplog from the profile and mark the oldest_minus_5s case of test_changeStream_early_start with requires(oplog=True), the one case that reads the oplog. The two collMod oplog cases (max_target_oplog, size_target_oplog) are already gated on oplog and are now skipped on Amazon DocumentDB. Signed-off-by: Samar Farooqi <samafarc@amazon.com>
…pplyOps Oplog access is covered by the separate oplog capability, so the replication description should name only applyOps to keep the two capabilities from overlapping. Signed-off-by: Samar Farooqi <samafarc@amazon.com>
… marker The requires gate reads only the closest requires marker, and the function-level change_streams marker sits closer than a case's own marker, so the oplog requirement on oldest_minus_5s was ignored and the case still ran on targets without a readable oplog. Move the change_streams requirement to module level and restate it on the oldest_minus_5s case alongside oplog, so the case marker is the closest one and carries both requirements. Signed-off-by: Samar Farooqi <samafarc@amazon.com>
max_target_oplog and size_target_oplog only check that collMod rejects cappedMax/cappedSize on local.oplog.rs with InvalidOptions. They need the oplog.rs namespace to exist, not a readable oplog, so gating them on oplog skipped them on Amazon DocumentDB, which returns InvalidOptions for both. Gate them on replication instead. They still run on a MongoDB replica set and are still skipped on a standalone, which has no oplog.rs. Signed-off-by: Samar Farooqi <samafarc@amazon.com>
2a39565 to
9087c2f
Compare
|
Thanks @eerxuan, all three are addressed:
|
test_changeStream_early_start.py called _oldest_oplog_ts(collection) for every case before running the command. Only oldest_minus_5s uses the value. zero, one_zero and max_increment ignore it. On an engine with no readable local.oplog.rs, those cases failed with StopIteration before the command ran, which hid whether the engine accepts an early startAtOperationTime.
Changes:
Testing (early_start + collMod capped_max + capped_size):
*_target_viewexcluded: mongod segfaults on it and its xcrash mark is scoped to engine=mongodb): main 80 passed, branch 77 passed with oldest_minus_5s x3 deselected.