Repository navigation
Conversation
…default
With defaultUseCompositeOpClass enabled, every index created through a
plain createIndexes came back from listIndexes with an extra field
MongoDB never returns:
"storageEngine": { "enableOrderedIndex": true }
which breaks clients and tools that compare or replicate index specs
(the entire CreateIndexes/DropIndexes groups of the FerretDB
compatibility suite fail on it, 36 cases).
The CustomIndexOption enum already distinguishes the two cases the old
TODO asked to separate: CustomIndexOption_True (the user explicitly
asked for the option — keep surfacing it) and
CustomIndexOption_DefaultTrue (the index is ordered merely because of
the server default — suppress it, matching the MongoDB response).
This resolves that TODO using the enum's own semantics.
Validated with the FerretDB compatibility suite against a real
MongoDB 7: CreateIndexes and DropIndexes groups go from 36 failing
cases to zero.
Co-authored-by: veluacode <no-reply@velua.ai>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Guilherme M. Prestes da Silva <gmprestes@gmail.com>
d87f6e9 to
da418e9
Compare
Maintainer update:
|
The previous commit stopped surfacing storageEngine.enableOrderedIndex in listIndexes and index_spec_as_bson when the option was set only by the server default. Refresh the nine expected files that still carried the old output; every hunk is exactly the storageEngine omission (plus the resulting psql column-width reflow), verified against the CI results of all four PG jobs (PG15-PG18). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Guilherme M. Prestes da Silva <gmprestes@gmail.com>
|
Thanks for merging main and for the detailed breakdown — that matched exactly what I found in the CI logs. I've pushed 7c374a1, which regenerates the nine stale expected files ( The new content was taken from the |
I rebuilt the original expected files from the regression.diffs the CI jobs printed rather than running the suites -- I wanted to save the build time -- so I only ever saw what CI had already printed before make aborted in check-regress. Since make runs "all: check-regress check-extended-rum ...", extended_rum_tests and the distributed suite never ran there, and their diffs could not appear in that log. Running the three suites properly turns up 9 more stale expected files -- 2 under pg_documentdb/src/test/extended_rum_tests and 7 under internal/pg_documentdb_distributed -- all still carrying storageEngine.enableOrderedIndex for indexes that only got it from the server default. Every diff was checked to contain nothing but that omission and the psql column reflow it causes. Verified green on PG15, PG16 and PG18, each suite run separately so none of them can mask another. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Guilherme M. Prestes da Silva <gmprestes@gmail.com>
|
@guanzhousongmicrosoft same correction as on #667, and it applies here too. You told me to regenerate by running the suites; I wanted to save the build time and rebuilt these expected files from the CI Running the three suites in a dev container turns up 9 more stale expected files — 2 in Verified green on PG15, PG16 and PG18. There is nothing to regenerate on PG18 — this change has no |

Problem
With
defaultUseCompositeOpClassenabled, every index created through a plaincreateIndexescomes back fromlistIndexeswith an extra field MongoDB never returns:This breaks clients and tooling that compare or replicate index specs — the entire CreateIndexes/DropIndexes groups of the FerretDB compatibility suite fail on it (36 cases).
Fix
The
CustomIndexOptionenum already distinguishes exactly the two cases the existing TODO inSerializeIndexSpecasks to separate:CustomIndexOption_True— the user explicitly asked for the option → keep surfacing it;CustomIndexOption_DefaultTrue— the index is ordered merely because of the server default → suppress it, matching the MongoDB response.This resolves that TODO using the enum's own semantics. Explicit
enableOrderedIndex: falsebehavior (gated byEmitEnableOrderedIndexFalseInResponse) is unchanged.Validation
FerretDB compatibility suite against a real MongoDB 7: CreateIndexes and DropIndexes go from 36 failing cases to zero; full suite (8 groups) clean, on two environments.
Reviewed by Claude (Fable 5 model) as part of an AI-assisted debugging session; the commit carries co-author trailers for the agents involved.
🤖 Generated with Claude Code