Repository navigation
Conversation
|
/agentic_review |
Code Review by Qodo
🟠 Medium 1.
|
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit d353d02 |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit e4b9c9c |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 5406fbd |
Replaying a dropDatabase event lists the target collections with
{name: {$not: {$regex: "^system\\."}}}. Plain mongod accepts it, the
Atlas Flex/M0 proxy rejects it with "(AtlasError) can't get regex from
filter doc not a regex" and the run ends in the failed state, with
resume --from-failure hitting the same event again. Native regex under
$not is rejected too, verified on a Flex 8.0.34 cluster.
ListDatabaseNames has the same problem on the source side: the proxy
only takes a string or regex for name, so {$nin: [...]} fails at clone
start.
Send an empty filter to listCollections and listDatabases and drop
system.* collections and admin/config/local in Go. The integration
tests record the command filter with a CommandMonitor, since mongod
cannot reproduce the rejection.
Integration tests bound their MongoDB work with util.CtxWithTimeout like the rest of the suite, and clean up with their own bounded contexts instead of the already-cancelled test context. Every new nolint directive carries its reason.
A transient error retried by RunWithRetryVal adds Started events while the helper still succeeds, so the recorder now requires at least the expected number of calls and still checks every captured filter.
The driver always encodes filter: {} for an empty document, so a missing
field is a changed command shape, not a valid no-predicate request. The
recorder now fails on it instead of skipping it.
PCSM-399
Problem
Replaying a
dropDatabaseevent on an Atlas Flex target kills the run:catalog.DropDatabaselists the target collections throughmdb.ListCollectionNames, which filters with{name: {$not: {$regex: "^system\\."}}}. Plain mongod (6.0 through 8.0 in CI) accepts that, the Atlas Flex/M0 proxy does not. It rejects any regex under$not, the native BSON regex form included, which I verified on a Flex 8.0.34 cluster. Once the run is infailed,resume --from-failurereplays the same event and fails again, so there is no way out without a new binary.mdb.ListDatabaseNameshas the same class of bug on the source side. The proxy accepts only a string or a regex forname, so the{$nin: ["admin","config","local"]}filter fails at clone start withExpected user provided "name" field in filter to be regex or string was bson.D instead. Nobody has hit that yet because Atlas has only been a target so far.Solution
Send an empty filter to
listCollectionsandlistDatabasesand excludesystem.*collections andadmin/config/localin Go. The result is the same list on every server that accepted the old filters, and the proxy has nothing left to reject (on Flex it hidessystem.viewson its own anyway).The integration tests record the outgoing command with a
CommandMonitorand assert the filter is empty. That is the only assertion that can guard this on a mongod-backed CI, since mongod happily runs the old filters.Verified against real Atlas clusters. On Flex 8.0.34 the old
mdbhelpers fail with the exact customer error and the patched ones return the expected names. On a dedicated M10 8.0.34 both old and new pass, so only the proxy tiers were affected.