Repository navigation
Description
Engine-side failures found in E2E runs on release/1.0-RC2-v2 @ 40f86c0. Images were documentdb-local PG17/PG18 built from that commit; clients were pymongo and mongosh.
Items
-
$lookupfails with "Unrecognized BSON data type code 0" -
$regexFindAll/$replaceAllon large input ignore statement_timeout and stall other collections' index builds - A reindex that fails in post-processing can never succeed on retry ("could not open relation with OID 0")
- New binary on an un-updated catalog: InternalError and misleading errors instead of a clear message
1. $lookup fails with "Unrecognized BSON data type code 0"
A plain $lookup with localField/foreignField fails on a fresh 1.0 install, and also on an upgraded catalog:
OperationFailure: Unrecognized BSON data type code 0, code 115 (CommandNotSupported)
We ran a self-lookup on a 1000-document collection with different indexes on the foreign side. No index, a single-field index, a partial index and a compound index all worked. The failure only appeared after a wildcard index ({"$**": 1}) was built on the foreign collection. That trigger is inferred from log timing and not yet isolated.
The error is raised by BsonTypeName() for type 0 (EOD) (pg_documentdb_core/src/io/pgbson_utils.c). This suggests the lookup or wildcard path reads an unset value.
2. Runaway string expressions can't be cancelled
The size_limit cases in the functional tests for $regexFindAll (a 16 MB string, regex a) and $replaceAll (empty-find amplification) behave like this:
- The gateway gives up at 121 s with
ExceededTimeLimit, but the backend keeps runningaggregate_cursor_first_page. PG never logscanceling statement due to statement timeout. - While it runs, background index builds on other collections hang, because
CREATE INDEX CONCURRENTLYwaits on its snapshot. - In our run it took about 12 minutes until the backend was SIGKILLed. That forced a cluster restart, and both stuck builds then finished within 50 ms.
pg_documentdb/src/operators/bson_expression_string_operators.c has no CHECK_FOR_INTERRUPTS(). Adding it to the regex-find-all and replace-all loops should fix the cancellation. A normal aggregate is cancelled correctly.
Related: #759 item 2 (client_connection_check_interval). These tests are also on the crash list in documentdb-local/functional-tests/config/ci_crash_tests.txt.
3. Reindex retry fails with "could not open relation with OID 0"
Repro:
- Run
createIndexeswith a unique-capable index, thencollMod prepareUniqueandcollMod unique. - Run
collMod {index: {..., reindex: true}}withdocumentdb.indexBuildFailurePoint = 5(post-processing).
What happens:
- The first attempt logs
Injected failure point 5 ... drop partial stateand marks the build Failed. - Both retries then fail with
Failure in post-processing index could not open relation with OID 0and end Failed, althoughcollModreturned ok. - The original index stays valid, so there is no data risk. But the reindex can never succeed, and the user isn't told.
The first failure drops the _ccnew index, and the retry still looks it up by name (create_indexes_background.c, the reindex post-processing). This cause is inferred.
4. New binary with an old catalog
We ran the 1.0-rc2 binary on a 0.109 catalog. This is the state right after a package or image upgrade, before ALTER EXTENSION documentdb UPDATE:
$groupreturnsInternalError(PG:could not find an aggregate named "documentdb_api_internal.bsonfirstwithexpr").- Creating a hashed index fails with
operator class "...documentdb_extended_rum_hashed_ops" does not exist, mapped to code 11UserNotFound. createUserwithreadWriteAnyDatabase+clusterAdminis rejected with "Only readAnyDatabase or readWriteAnyDatabase+clusterAdmin are allowed built-in roles", which is exactly the combination requested.
After ALTER EXTENSION documentdb UPDATE everything works, and the data and all 11 indexes survived.
Expected: features that need a newer catalog fail with a clear "run ALTER EXTENSION documentdb UPDATE" message instead of InternalError or unrelated error codes. Neither the packages nor the container run that update today; see #771 (packaging) and #773 (documentdb-local).
Activity
guanzhousongmicrosoft commentedon Nov 23, 2026
On main the documentdb-local image runs
ALTER EXTENSION ... UPDATEat boot (53e5456), so the container no longer runs on an old catalog. Still open: a clear error instead of InternalError on an old catalog, items 1 and 2, and confirming whether a9ca0f7's catalog-lookup refresh fixes the reindex retry in item 3.