mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 19:59:54 -05:00
e640ba76a7cabfcdee243c35c84ff6b73acdfafc
822
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e640ba76a7 |
Merged PR 1689393: Introduce a mechanism to swith between C# and Rust gateways at runtime
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description This change allows us to swap between C# and Rust gateways by setting the pgmongo.use_rust_native_gateway GUC on and off without depending on Flex "outside" restarts and trigger the restart at runtime. We read the value of the GUC and if it doesn't match the running gateway, we gracefully shut it down. Upon restart by Docker, C# flow will be executed and StartupHost.sh will be executed. Since the GUC, pgmongo.use_rust_native_gateway, will also be set in a config file, and that will mandate the gateway to actually start up. This change was validated against a dev cluster by setting the GUC on and off ---- #### AI description (iteration 1) #### PR Classification This pull request introduces a new mechanism for runtime gateway switching, enabling a graceful shutdown of the C# gateway to transition to a Rust gateway. #### PR Summary The changes implement a unified shutdown mechanism that allows the service to detect a configuration flag for using the Rust native gateway and to trigger a graceful shutdown accordingly. - **`Compute.Host/HostShutdown.cs`**: Added a new static class that provides a shutdown task and trigger method. - **`Compute.Host/HostServiceContainer.cs`**: Introduced a configuration check for the "use_rust_native_gateway" flag that triggers shutdown via the new mechanism. - **`Host.Postgres.Linux/PostgresMongoServiceHost.cs`**: Updated shutdown and signal handling to use the new HostShutdown mechanism, replacing the previous ctrl-break task approach. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
c6bc2bcb73 |
Merged PR 1694458: [POC|Order by] Order by Index & Pushdown improvements
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description More general improvements to order by and composite: Create Indexes 1) Support creating a composite index side by side with a regular index 2) Block creation of descending or wildcard and unsupported set ups for composite indexes Planner: 1) Support ordering by the Nth path of an index if the prefixes are equality. 2) Validate that if it's not the first column, prefixes are provided 3) Support incremental sort with index pushdown. ---- #### AI description (iteration 1) #### PR Classification This pull request delivers a new feature and API enhancement to enable order-by index pushdown and refined composite index support. #### PR Summary The update streamlines composite index processing by introducing stricter equivalency checks, new UDF functions for full-scan order-by pushdown, and enhanced validations during index creation while updating explain outputs and tests. - `src/metadata/index.c` refines index options equivalency logic to correctly compare composite term settings. - `src/opclass/bson_gin_composite_entrypoint.c` and `src/index_am/rum.c` add functions to support order-by pushdown and manage duplicate entries efficiently. - `sql/udfs/query/bson_dollar_comparison--0.105-0.sql` (and related operator files) introduce new UDFs including `bson_dollar_fullscan` to enable full scan operations. - `src/commands/create_indexes.c` enforces new composite index validations (restricting use to ascending, non-wildcard regular indexes) with precise error reporting. - Test scripts and explain plan outputs in the `regress` and `pgmongo` directories are updated to confirm the new composite order-by behavior. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
3269f4269e |
Merged PR 1694107: [perf] Omit collationString alloc
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description more ---- #### AI description (iteration 1) #### PR Classification Performance optimization. #### PR Summary This PR eliminates an unnecessary memory allocation during BSON parsing by omitting the call to `pstrdup` for the collation string. - `/oss/pg_documentdb_core/src/io/pgbsonelement.c`: Replaced `pstrdup(bson_iter_utf8(&iter, NULL))` with a direct pointer assignment from `bson_iter_utf8(&iter, NULL)`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
79927cae0d |
Merged PR 1694933: [Oss] [documentdb] - Fix match filters not applied on lookup unwind aggregation stage
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
- Fix $match filters not applied after preserving null on $lookup and $unwind combinations
### Description
This fixes the OSS issue: https://github.com/microsoft/documentdb/issues/198
- Starting PG 16 the the right join query that will have NULL results need to assign `varnullingrels` index of RTE which can replace the NULL values for outer JOIN conditions, if the VAR expression is a result of JOIN.
This is seen as the diff in the parse plan of not working and working case of the same query in PG 16

The final query described in the bug has below format and the last `WHERE` filter can merge with the inner right query if `varnullingrels` is not specified which yields incorrect results
```SQL
SELECT document
FROM ( WITT debug_print_parse to on;
LECT document
FROM ( WITH "lookupLeftCte_0" AS (
SELECT collection.document,
bson_dollar_lookup_extract_filter_expression(collection.document, '{ "name" : "author" }'::bson) AS lookup_filter
FROM documentdb_data.documents_3 collection
WHERE collection.shard_key_value = '3'::bigint
)
SELECT bson_dollar_merge_documents_at_path(lookup_stage_1.document, COALESCE("lookupRight_stage_1".document, '{ }'::bson), 'author-names'::text) AS document
FROM "lookupLeftCte_0" lookup_stage_1
LEFT JOIN LATERAL ( WITH lookup_right_query AS (
SELECT collection_0_1.document
FROM documentdb_data.documents_2 collection_0_1
WHERE collection_0_1.shard_key_value = '2'::bigint
)
SELECT lookup_right_query_stage_0.document
FROM lookup_right_query lookup_right_query_stage_0
WHERE bson_dollar_lookup_join_filter(lookup_right_query_stage_0.document, lookup_stage_1.lookup_filter, 'name'::text)) "lookupRight_stage_1" ON true) agg_stage_1
WHERE document #= '{ "title" : "Emma" }'::bsonquery;
```
----
#### AI description (iteration 1)
#### PR Classification
Bug fix addressing the incorrect application of match filters in aggregation pipelines combining $lookup and $unwind stages.
#### PR Summary
This pull request fixes the issue by updating the aggregation pipeline processing logic for null-preserving $lookup/$unwind operations and enhancing test coverage to verify correct filtering.
- **`oss/p...
|
||
|
|
3217a57219 |
Add prebuild image tasks in GH action (#212)
* first commit * update action * fix * fix * test push * test push * test push * test push * test push * test push * add lables * update tag * clean up * try to resolve unknown/unknown * clean up * test sign * clean up * update action name * fix bug * clean up --------- Co-authored-by: root <root@CPC-yangq-FRSGK> |
||
|
|
a948405ed4 | Update codeql.yml to use ubuntu22.04 (#214) | ||
|
|
eb0f928e7f | DocumentDB sync sha=e995ad4e9 | ||
|
|
c75e824ee7 |
Merged PR 1694497: update ignore field to support mongoimport for mongo8.0
### Does this PR have any customer impact? Unblock customer using mongoimport with 8.0 cluster ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) N/A ### Description In the [ticket](https://portal.microsofticm.com/imp/v5/incidents/details/627206133/summary), cx reported an error while using mongoimport with 8.0 cluster There might be typo in cx's statement, as we have ignored startTransaction in our code. However, the mongoimport does fail with 8.0 cluster, with error saying "Failed: (UnknownBsonField) BSON field 'insert.bypassEmptyTsReplacement' is an unknown field"  bypassEmptyTsReplacement was [introduced in mongo 5.0](https://www.mongodb.com/docs/manual/release-notes/5.0/#:~:text=SERVER%2D88750%20Add%20%22bypassEmptyTsReplacement%22%20param%20to%20insert%2C%20update%2C%20findAndModify%2C%20and%20bulkWrite). It seems mongoimport add `bypassEmptyTsReplacement` field for 8.0 clusters, which leads to insertion failure with vCore 8.0 version but not on 7.0 This PR adds bypassEmptyTsReplacement to ignore field to unblock cx from using mongoimport ---- #### AI description (iteration 1) #### PR Classification This pull request implements a new feature to support mongoimport in mongo8.0. #### PR Summary The update adds the "bypassEmptyTsReplacement" field to the list of ignored fields in the `oss/pg_documentdb/src/commands/commands_common.c` file, ensuring compatibility for insert, update, findAndModify, and bulkWrite commands when using mongoimport. - `oss/pg_documentdb/src/commands/commands_common.c`: Inserted "bypassEmptyTsReplacement" into the ignore list for relevant commands. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
597852a2c6 |
Merged PR 1694353: Move $bucketAuto to schema 105
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Move bucketAuto to schema 105 ---- #### AI description (iteration 1) #### PR Classification This pull request introduces a schema migration for the `$bucketAuto` aggregation stage, moving its support from schema 104 to schema 105. #### PR Summary The changes update documentation, SQL scripts, and test configuration to reflect the migration of `$bucketAuto` support to the new schema. - `pgmongo/sql/pgmongo--1.104-0--1.105-0.sql`: Added inclusion of the new `$bucketAuto` UDF file for schema 105. - `oss/pg_documentdb/sql/documentdb--0.104-0--0.105-0.sql`: New file added to include `$bucketAuto` support for the updated schema. - `oss/CHANGELOG.md` and release notes files: Updated to move the `$bucketAuto` aggregation stage support from the previous schema version to the new release notes for schema 105. - Several test CSV files under `/gateway/managed/Tests.Integration.Shell.Postgres` were updated to reflect the new schema version. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
3f8294a36a |
Merged PR 1689621: Change default for localhost to false
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Change default for localhost to false ---- #### AI description (iteration 1) #### PR Classification This pull request is a configuration change that updates the default behavior for local host usage. #### PR Summary The changes modify the configuration setup to return false by default for using localhost, ensuring that the application does not use the local host unless explicitly configured. - `oss/pg_documentdb_gw/src/configuration/setup.rs`: Changed the `use_local_host` method to use `unwrap_or(false)` instead of `unwrap_or(true)`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
69f291ab31 |
Merged PR 1692865: Support pushdown of with shard keys specified with $in
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description In a distributed set up, shard keys specified with $and/$eq/$or were tracked but not $in. This adds support for $in as well in pushdown. ---- #### AI description (iteration 1) #### PR Classification New feature to enhance sharding by supporting pushdown of queries with shard keys specified using the $in operator. #### PR Summary This pull request extends the sharding logic to process $in operator predicates for shard keys, optimizing query routing and pushdown. - `oss/pg_documentdb/src/sharding/sharding.c`: Added new helper functions (e.g., FindShardKeyValuesExprPhase1, ConsiderShardKeyFiltersForInClauses, and FindShardKeyValuesExprNew) and refactored shard key handling to use a new `ShardKeyMetadata` structure with updated `setCount` tracking. - `oss/pg_documentdb/src/configs/feature_flag_configs.c`: Introduced the `UseNewShardKeyCalculation` flag to enable the new shard key calculation logic. - Test files and SQL regression scripts: Updated expected outputs and queries to validate the new $in operator support for shard key pushdown. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
17d4306a28 |
Merged PR 1422337: [pgmongo] Aggregate stage $bucketAuto implementation
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description This pull request adds documentation for the `$bucketAuto` aggregation stage in PostgreSQL, detailing its design, usage, and implementation. - Adds `bucketAuto.md` with details on the `$bucketAuto` aggregation stage - code implementation - support all granularity types: POWERSOF2, 1-2-5, Renard numbers, E series Related work items: #3234185 |
||
|
|
06a96c8975 |
Merged PR 1691723: Fix up correctness of composite and orderby
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix/Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description 1) Orderby on null/undefined documents was incorrect - fix up the ordering 2) Equality on null/undefined was also incorrect fix this up 3) When traversing the document, we were doing an extra traversal into arrays when it was not needed. fix this up 4) Order by on composite index didn't handle nulls correctly - fix this too. 5) Support pushdown of $elemMatch into composite indexes without array terms. ---- #### AI description (iteration 1) #### PR Classification This pull request fixes bugs in the composite index and orderby functionality. #### PR Summary The changes correct the orderby comparison logic and improve composite index term generation in BSON processing. The pull request also adds new functions to handle intermediate array paths and introduces legacy behavior flags, while supplementing the fixes with comprehensive integration tests. - **`src/query/bson_dollar_operators.c`**: Modified `OrderByVisitArrayField` to pass the correct BSON value and added new functions for array path handling. - **`src/opclass/gin_index_term.c` and related opclass files**: Introduced `GenerateValueMaybeUndefinedTerm` and updated index term comparison to distinguish between undefined and partially undefined values. - **`pgbson_utils.c`**: Adjusted array traversal logic with a new callback for missing intermediate array paths and a flag to control array traverse optimization. - **Test files under `/oss/pg_documentdb/src/test/regress/expected/` and `/pgmongo/src/test/regress/expected/`**: Added extensive composite ordering and filtering tests to validate the corrected behavior. - **`configs/feature_flag_configs.c`**: Added custom GUCs for `useLegacyOrderByBehavior` and `useLegacyNullEqualityBehavior` to manage legacy ordering and null equality rules. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
c71b269fb8 |
Merged PR 1692164: Upgrading toolchain to remove warnings in PR gates
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Upgrading toolchain to remove warnings in PR gates. "Installing an old toolchain, please consider upgrading. Latest available toolchain for v1 is 1.87." Tested locally in dev container to make sure the gateway started and there were no cargo dependency issues ---- #### AI description (iteration 1) #### PR Classification Toolchain upgrade to address warnings in PR gates. #### PR Summary This pull request updates the Rust toolchain version used in both the development container and pipeline configuration to maintain consistency and eliminate warning messages. - `/.devcontainer/Dockerfile`: Updated the MSRUSTUP_TOOLCHAIN from ms-1.84.1 to ms-1.87.0. - `/.pipelines/templates/common_variables.yml`: Set RustToolchainVersion to ms-1.87.0. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
2c5ab611d7 |
Merged PR 1692296: Version update for 104
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Version update for 104 Related work items: #4281831 |
||
|
|
0ddb09436c |
Merged PR 1690832: [Composite] Remove array term generation for composite indexes
### Does this PR have any customer impact? Not yet ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature/POC ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description This adds more changes for orderby support in the index 1) Fixes the correctness issue arising from indexing arrays for order by - we remove the top level array term from indexing. To handle this, we move the query operators to support querying the index correctly when the query is on an array 2) For `$elemMatch` this temporarily makes elemMatch just a full scan for now (a subsequent change wil tackle updating the logic) 3) Adds orderby to the top level schema for the internal extension 4) For exists false/true, we were pushing a lot more terms to the runtime recheck. Ensure that we're hitting the right index terms and evaluate correctly against the index. ---- #### AI description (iteration 1) #### PR Classification This pull request is a code cleanup and enhancement that removes array term generation for composite indexes and updates related index term handling. #### PR Summary The changes streamline composite index generation by eliminating dedicated array terms, and they adjust boundary, metadata, and recheck logic to ensure consistent behavior. Key updates include: - **`oss/pg_documentdb/src/opclass/bson_gin_composite_core.c`**: Removed redundant array term generation and introduced functions like `SetArrayEqualityBound` to properly handle equality bounds for arrays. - **`oss/pg_documentdb/src/opclass/gin_index_term.c`**: Updated index term serialization and metadata management (including handling of undefined values via `GenerateValueUndefinedTerm`) to align with the new composite index behavior. - **Test and expected output files**: Revised expected composite index term outputs and SQL tests to reflect the removal of array-specific terms. - **Documentation and configuration**: Updated design docs and removed the configuration flag for skipping array term generation, consolidating the new composite index strategy. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->v0.104-0 |
||
|
|
4b419d9b40 |
Merged PR 1671857: Adding support for custom index handler
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) Adding support for custom index handler. ### Description Adding support for custom index handler. Currently the default index access method to index bson data type is "rum". This change allows one to swap out "rum" for something else. The use an alternate index handler one needs to specify two things 1. Firstly, register the index handler and its capabilities and relevant utility call backs. Currently, the system only allows a maximum of 5 alternate index handler. 2. Secondly, set the alternate_index_handler GUC to let the system chose the alternate index handler to index bson. Following are a few notes on the mechanism 1. During index create if the alternate AM does not support certain kind of bson index (e.g, unique index, wildcard index) then the index is created via the default rum index. Otherwise, the alternate AM is chosen. 2. If an index has been created using alternate index AM but then reset the alternate_index_handler GUC or set it to another third alternate index AM, the old alternate index AM will still be in use, and long as both the old and new alternate index AM are in the registry. Other: Fixed Densify and SetWindow fields flakey tests for sharded collection ---- Related work items: #3796361 |
||
|
|
fe2f9a7ee7 |
Merged PR 1639930: Add Extensible Support for Role Privileges in UsersInfo Command
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description We've implemented several key improvements to DocumentDB's user management system, with a focus on enhancing the `usersInfo` command to support privilege information display. ### Feature Overview - Added support for the `showPrivileges` flag in `usersInfo` command - When enabled, user information responses now include detailed privilege documents - Privileges are organized by resource and action, similar to MongoDB's privilege format ### Implementation Details 1. **Privilege Data Structures** - Created predefined privilege sets for each role type (readOnly, readWrite, clusterAdmin) - Designed efficient merging of privilege sets with hash-based deduplication 2. **GUC Configuration** - Added `EnableUsersInfoPrivileges` boolean GUC to control feature availability 3. **Command Flow** - Parse `showPrivileges` flag from incoming BSON documents - When flag is true and GUC is enabled, append privilege array to user documents - Privileges include resource targets (cluster/database/collection) and action lists 4. **Memory Optimization** - Implemented hash-based privilege merging to avoid duplicate entries - Proper memory management with PostgreSQL allocation functions This functionality supports the `connectionStatus` command, which requires authenticated user privileges. We will also support `dbowner` and `root` roles, which will come in a follow-up PR. Related work items: #3852887 |
||
|
|
90b141027e |
Merged PR 1684027: Add mongo 8 support to gateway
### Does this PR have any customer impact? Nothing negative ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) Support Mongo version 8 in pg_documentdb_gw *[Feature]* ### Description Add mongo 8 to list on version.rs ---- #### AI description (iteration 1) #### PR Classification This pull request is an enhancement, adding native support for Mongo 8. #### PR Summary The changes update versioning in the OSS gateway to support Mongo 8 by extending the existing enum and its associated conversion methods. - `oss/pg_documentdb_gw/src/configuration/version.rs`: Added the `Eight` variant to the enum and updated methods to parse "8.0", return `"8.0.0"`, provide the version tuple `[8, 0, 0, 0]`, and assign the corresponding numerical value. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4094504 |
||
|
|
96924b8eee |
Merged PR 1672438: Support Compact in the vCore Backend engine
Yes Feature Yes No - Support compact database administration command behind the GUC `enableCompact`. - Add support for compact command in backend using VACUUM FULL which is a blocking operation. - Only one compact command can be run at a time on a specified collection. - VACUUM FULL is run using libpq in a top level transaction as it it not supported inside functions or procedures. - Add support of tracking compact command in current_op. - `dryRun` estimation is based on the query defined [here at pgexperts](https://github.com/pgexperts/pgx_scripts/blob/master/bloat/table_bloat_check.sql), this can be a rough estimation and doesn't provided details about the space reclaimed by vacuuming RUM indexes of the collection. - Read only users can't perform `compact` command. ---- New feature implementation to support the backend compact command. This PR adds complete backend support for a blocking compact command that estimates table bloat and conditionally performs a VACUUM FULL operation on collection tables. - `src/utils/storage_utils.c` and `include/utils/storage_utils.h`: Introduced a new bloat estimation utility returning collection bloat stats. - `src/commands/compact.c`: Implemented the compact command including BSON command parsing, dry-run handling, and conditional execution of VACUUM FULL. - `internal/pg_documentdb_distributed/src/test/regress/sql/command_compact.sql`: Added regression tests covering various compact command scenarios. - `include/utils/feature_counter.h` and `src/infrastructure/feature_counter.c`: Updated feature counter mapping to include the new compact command feature. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4237921 |
||
|
|
c8fdba1168 |
Merged PR 1684751: [Composite|Order] Supporting order by on composite index
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description ---- #### AI description (iteration 1) #### PR Classification This pull request introduces a new feature to support “order by” queries on composite indexes and refines how composite query operators are handled. #### PR Summary The changes enable ordering by composite indexes by expanding the $all operator into an AND of expressions, adjusting index pushdown and term generation logic, and enforcing index-only paths when sequential scans are disabled. Key changes include: - **`src/query/query_operator.c`**: Added the `ExpandExprForDollarAll` function to decompose $all into composite AND expressions, and integrated its use controlled by a new feature flag. - **`src/planner/documents_planner.c`**: Introduced helper functions (e.g. `TrimPathListForSeqTypeScans` and `ForceExcludeNonIndexPaths`) to eliminate sequential scan paths when `ForceDisableSeqScan` is enabled, ensuring better index-based execution. - **`src/configs/feature_flag_configs.c` & `src/configs/testing_configs.c`**: Added new configuration flags like `ExpandDollarAllInQueryOperator`, `SkipGeneratingArrayTermForCompositeIndex`, and `ForceDisableSeqScan` to control composite index behavior. - **Composite Index Code (e.g. in `bson_gin_composite_entrypoint.c` and related files)**: Updated index strategy handling and term generation to support composite ordering and correct treatment of array terms. - **Test Files**: Numerous expected output and SQL regression tests (both in the distributed and pgmongo modules) were updated to reflect the new composite index ordering and query operator changes. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
4b838722e2 | DocumentDB sync sha=d16a10888 | ||
|
|
11fab5ffc6 |
Merged PR 1683133: [engine] More Feature Counters
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Dev ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Add more feature counters for let, cursor types and top-level commands ---- #### AI description (iteration 1) #### PR Classification This pull request implements a new feature by adding and tracking additional feature counters in the engine. #### PR Summary This change adds new feature counter entries and instrumentation to track usage for several commands and top-level "let" support. The updates include increasing the feature count limit and inserting ReportFeatureUsage calls in relevant command and aggregation pipelines. - `src/infrastructure/feature_counter.c` and `include/utils/feature_counter.h`: Added new feature counter mappings and enums for commands (e.g., agg_cursor_first_page, count, distinct, find_cursor_first_page, get_more, list_collections_cursor_first_page, list_indexes_cursor_first_page) and top-level "let" support. - `src/aggregation/bson_aggregation_pipeline.c`: Integrated ReportFeatureUsage calls for "let" in aggregate and find queries. - `src/commands/aggregation_commands.c`: Inserted ReportFeatureUsage calls in various command functions to track usage of the new feature counters. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4224518, #4228942 |
||
|
|
ec1c0f67c6 |
Merged PR 1685390: [engine] Rename EnableLetForWriteCommands GUC
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Rename ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No, no ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Rename `EnableLetForWriteCommands` to `EnableVariablesForWriteCommands`. The GUC controls support for both `let` variables and $$NOW. Thus, it is more intuitive and clearer. ---- #### AI description (iteration 1) #### PR Classification This pull request implements an API renaming change by updating the GUC from “enableLetForWriteCommands” to “enableVariablesForWriteCommands”. #### PR Summary The changes standardize the configuration naming across tests, source code, and documentation to improve clarity and consistency for write command variable handling. - **`oss/internal/pg_documentdb_distributed` & `pgmongo` tests:** Expected output files and SQL scripts are updated to reflect the new GUC name. - **`pg_documentdb/src/configs/feature_flag_configs.c`:** The custom bool variable and its initializer now use the new naming. - **Core source files:** References in `commands/delete.c`, `planner/documents_planner.c`, and `query/query_operator.c` have been updated to use “enableVariablesForWriteCommands”. - **Documentation and setup:** The `CHANGELOG.md` and `scripts/utils.sh` are revised to document and configure the renamed GUC. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
f73f559f5d |
Merged PR 1680296: Adding Support for Verbose Trace in the Rust Gateway
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Livesite ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Complete compute request tracker implementation in the rust gateway to meet parity with the c# gateway, which will measure and record durations of major components involved in servicing Mongo tcp and http requests. The duration interval kinds we collect can be found in the request_tracker.rs. In this PR, we temporarily wrap ComputeRequestTracker inside RequestInfo. There is a subsequent code refactoring PR that introduces RequestContext which will be the permanent location referencing the tracker and will be passed down to all lower functions. Related work items: #4139219 |
||
|
|
c55b1785e4 |
Merged PR 1684561: [Livesite] Updates for logging improvements
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Livesite ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description - Add logging of Postgres PID in error messages - Add more logging in the create indexes path ---- #### AI description (iteration 1) #### PR Classification This PR implements logging improvements to enhance diagnostics and error tracing. #### PR Summary The changes refine logging functionality across multiple components by capturing additional context and improving log formatting. - `pgmongo/src/infrastructure/logger_hooks.c`: Added a `log_raw_message` flag and corresponding logic to capture raw log messages and promote detail logs. - `gateway/managed/Mongo.Postgres.Runtime`: Updated various files (including `PostgresClient.cs`, `PostgresClientProvider.cs`, `SystemPostgresClient.cs`, `PostgresConnectionHandle.cs`, and related tests) to include the backend process ID in exception, retry, and connection logs. - `gateway/managed/Compute.Core/Diagnostics/DiagnosticsTrace.cs`: Enhanced exception tracing by incorporating a log level indicator in trace messages. - `oss/pg_documentdb/src/commands/create_indexes_background.c`: Improved index creation logging by adding detailed context (file name, line number, and max attempt notifications). <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
d75debabb4 |
Merged PR 1683166: [POC| Orderby] Support order by index pushdown with truncation
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) PoC ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Add support for orderby runtime recheck and plumb checks for truncation into the index With this we can have the runtime recheck the orderby and the index handle the base walking of the tree. Additionally, add support for transforms from the index key to the runtime key so that we can pass down the representation. ---- #### AI description (iteration 1) #### PR Classification This pull request introduces a new feature by adding support for order-by index pushdown with truncation. #### PR Summary The changes overhaul the ordering and scan logic in the RUM index to correctly handle pushdown of order-by operations when truncation occurs. - In `pgmongo_rum/src/rumget.c`, scan functions were refactored to incorporate new recheck logic and a helper (`PrepareOrderedMatchedEntry`) for processing ordered entries. - In `oss/pg_documentdb/src/opclass/bson_gin_composite_entrypoint.c`, a new ordering transform function (`gin_bson_composite_ordering_transform`) was added and comparison logic modified to signal truncation. - In `pgmongo_rum/src/rumscan.c` and `pgmongo_rum/src/rumvalidate.c`, the handling and validation of ordering keys were updated to support raw ordering keys with new function signatures. - In regression test files under `/pgmongo/src/test/regress`, tests were enhanced to verify ordering with truncation. - In `pgmongo_rum/src/rum.h`, default settings and structure fields were updated to enable order-by raw keys and track recheck status for ordering. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
addf8f18e0 |
Merged PR 1592678: [engine][let] Support for delete
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No
### Are you introducing any new config? If yes, do you have tests with and without them being set? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support `let` variables and `$$NOW` in delete queries.
The values of the variables can be accessed in the query by using `$expr`.
Example:
```
{
delete: <collection>,
deletes: [
{
q: {$expr: {$eq: ["$_id", "$$varRef"]}},
limit: 0, // multi
}
],
let: {"varRef": 1},
...
}
```
We parse the `let` value (together with the time system variables - `$$NOW`) and propagate it through the aggregation and variable contexts.
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for the `let` clause in delete operations.
- `delete.c`: Implemented logic to handle `let` clause in delete queries, including variable specification and collation.
- `bson_aggregation_pipeline_tests_let.out`: Added extensive test cases to validate the new `let` clause functionality in delete operations.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #3423118, #3613877
|
||
|
|
7d9280333a |
Merged PR 1681220: Restore the partity between c# and rust setup configuration
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description restore the partity between c# and rust setup configuration ---- #### AI description (iteration 1) #### PR Classification This pull request implements a configuration design change to align Rust's setup configuration with its C# counterpart. #### PR Summary The PR updates multiple configuration JSON files and associated Rust code to flatten and standardize the configuration structure. Key changes include: - **`SetupConfiguration.Cloud.json`**: Removed the nested `DocumentdbConfiguration` object and promoted its keys to the top level. - **`SetupConfiguration.JsTests.json` & `SetupConfiguration.JsTests.ADO.json`**: Flattened the JSON structure by eliminating the nested configuration key. - **`src/main.rs`**: Moved the configuration logging and added a clone for the setup configuration when passing it to `get_service_context`. - **`src/configuration/setup_configuration.rs`**: Applied the `#[serde(flatten)]` attribute to the `documentdb_configuration` field for proper deserialization. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
46948103f8 |
Merged PR 1681443: Dollar Range Fix for Composite Indexes
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Fix bug with composite index and NaN query - this was due to `$range` not pushing the individual $lt/$lte clauses - call into common code here. ---- #### AI description (iteration 1) #### PR Classification Bug fix addressing incorrect dollar range handling for composite indexes and related configuration/script adjustments. #### PR Summary This pull request refactors the dollar range logic in composite indexes by replacing legacy bound assignments with a strategy-based approach and streamlines associated configuration scripts. - **`/oss/pg_documentdb/src/opclass/bson_gin_composite_core.c`**: Replaces manual bound calculation with a new strategy (using SetSingleRangeBoundsFromStrategy) to properly handle inclusive/exclusive bounds for both minimum and maximum values. - **Shell scripts (`/scripts/utils.sh` and `/scripts/start_postgres_server.sh`)**: Remove deprecated gateway parameter handling and add extra configuration file support. - **Test output files**: Update expected query results by removing unnecessary _id filtering and reflecting corrected row outputs. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
983a7390f7 |
Merged PR 1657382: Fixed create_indexes tests to use correct documentdb function
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Previously, our integration tests were using create_index, but documentdb only supports create_indexes (plural) ---- #### AI description (iteration 1) #### PR Classification Bug fix for a failing test. #### PR Summary This pull request fixes the `create_indexes` and `drop_indexes` tests to correctly use the `create_indexes` function for compatibility with a DocumentDB backend. - `integration_tests.rs`: Updated `create_indexes` and `drop_indexes` tests to use `create_indexes` with a list of `IndexModel` objects, ensuring proper function calls and assertions. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4014913 |
||
|
|
f4896e9c81 |
Merged PR 1670376: [ReleaseValidation] Add release validation tests for hnsw/diskann/filtering/compression
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Testing ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description 1. Check the max dimensions when creating the vector index, previously checked by pgvector 2. Add the following release validation tests: - HNSW index (M40 and above) - DiskANN index (M30 and above) - Filtering search (GA) - Exact search (GA) - Compression half (GA) - Compression PQ (GA) ---- #### AI description (iteration 1) #### PR Classification This pull request implements new vector search release validation tests and updates the backend’s vector index dimension checks and error messaging. #### PR Summary The changes add comprehensive release validation tests for vector search covering various compression types (PQ, half), index kinds (ivf, hnsw, diskann), filtering, and exact match scenarios. - `outerLoop/releaseValidation/testSpecs/` now includes multiple new JSON spec files (e.g. ValidateVectorSearchCompressionPQ.json, ValidateVectorSearchCompressionHalf.json, ValidateVectorSearchDiskANN.json, ValidateVectorSearchHNSW.json, ValidateVectorSearchFiltering.json, and ValidateVectorSearchExact.json) with updated expected errors. - Test scripts in `ReleaseValidation.Tests.NodeJs/test/test_signoffTestsNodeJS.js` and C# signoff test file `SignoffTestsCSharp.cs` have been modified to enable and incorporate these new vector search tests. - In `pg_documentdb/src/commands/create_indexes.c`, additional checks enforce maximum dimensions based on compression type (non-compressed: 2000, half: 4000, PQ: as defined) and update error messages accordingly. - Several Postgres gateway and pgmongo files have been updated to remove obsolete regexes and return revised error codes (e.g. error code 67) and messages for exceeding vector dimension limits. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
094d546f64 |
Merged PR 1680621: Use OSS RUM source in OSS build
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Use OSS RUM source in OSS build ---- #### AI description (iteration 1) #### PR Classification This pull request implements a feature update to enable the OSS build to use the OSS RUM source through configurable parameters and script modifications. #### PR Summary The PR refactors build scripts and extension routines to support toggling between private and OSS RUM sources. Key changes include: - **`scripts/pipeline_build_extension_core.sh`**: Converted positional parameters to flag-based arguments using getopts and added a conditional to select OSS RUM installation. - **`pipelines/templates/extension_build_core.yml` & `.pipelines/templates/oss_documentdb_build.yml`**: Introduced the `useOssRumRepo` parameter to control whether the OSS RUM source is used. - **`/oss/pg_documentdb/src/index_am/rum.c`**: Updated index routine functions to directly call OSS-specific implementations when the new composite index feature is enabled. - **`scripts/build_dev_flex_container.sh`**: Adjusted the call to the pipeline build script to use the new flag-based argument format. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
e9fe920592 |
Merged PR 1680387: Updated feature_flag_configs.c to enable rum_index_scan to true
Updated feature_flag_configs.c to enable rum_index_scan to true ---- This pull request updates a configuration flag to enable a new feature by default. The pull request changes the default setting of RUM index scan from false to true in the configuration file, activating the feature system-wide. - `oss/pg_documentdb/src/configs/feature_flag_configs.c`: Changed `DEFAULT_ENABLE_RUM_INDEX_SCAN` value from false to true. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
7658398f9b |
Merged PR 1679366: [POC] Persisted cursors files without holding connections
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) PoC/Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Today, persisted cursors require the connections to be held. This is bad since Connections/Backends are a limited resource. This introduces the option to save the cursor state in a file on disk and reuse that across backends. This is behind a GUC due to the presence of the following: 1) Needs more testing and validation 2) Needs backpressure to ensure that disk consumption doesn't balloon up 3) There is a procedure added to clean up these files but it is not wired up 4) We need to handle ultra-large responses (beyond 4 GB it fails outright at the moment). This needs more graceful handling to split into chunks. ---- #### AI description (iteration 1) #### PR Classification This pull request is a new feature implementation that introduces file‐based persisted cursors to allow query results to be “drained” and stored on disk without holding on to active database connections. #### PR Summary This PR adds support for persisting cursor state to the filesystem in both the pg_documentdb and pgmongo modules, enabling connections to be released while still allowing cursors to be later resumed. The changes include: - **`infrastructure/cursor_store.c` and `cursor_store.h`** – New APIs for creating, writing to, reading from, and closing persisted cursor files. - **Commands integration** – Modifications in `commands/cursors.c`, `commands/aggregation_commands.c`, and `cursor_private.h` to use file-based cursor functions for draining and continuation. - **SQL test suites** – Addition of new test files (e.g. in `.../regress/sql/bson_aggregation_cursor_tests_file.sql`) to validate cursor behavior across various query scenarios. - **Configuration updates** – New custom GUCs in `feature_flag_configs.c` and adjustments in test PostgreSQL configuration files to enable and control file-based persisted cursors. - **Executor enhancements** – Updates in cursor draining and query plan execution functions to support both in-memory and file-based cursor paging. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
0d616cdcde |
Merged PR 1679451: Make first page cursor batch size configurable via GUC
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Make first page cursor batch size configurable via GUC ---- #### AI description (iteration 1) #### PR Classification This pull request implements a new feature by introducing a configurable GUC for the first page cursor batch size. #### PR Summary The changes enable users to control the default batch size for the first page of cursors through a custom GUC, ensuring it respects underlying limitations. - `src/configs/system_configs.c`: Added a custom integer variable (`defaultCursorFirstPageBatchSize`) with a default value and proper bounds via the GUC interface. - `src/commands/aggregation_commands.c`: Updated the first page query data generation to use the new configurable variable instead of a hardcoded value. - Test files under `/oss/pg_documentdb/src/test/regress/`: Extended both SQL and expected output tests to verify the behavior of the GUC under various configurations. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4225119 |
||
|
|
b204b58b82 |
Merged PR 1619783: [engine][collation] Support for sort in runtime
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes, yes ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support sorting with collation. We define new custom sort operators which compare operands using applicable collation string. `<<<` is for ascending order. `>>>` is for descending order. Example: `SELECT * from <collection> ORDER BY <value> USING <<<` This will further be used for partitioning, grouping, and related comparisons. ---- #### AI description (iteration 1) #### PR Classification New feature: Support for collation in sort operations. #### PR Summary This pull request adds support for collation in sort operations within the database engine. - `src/test/regress/expected/bson_dollar_ops_collation_tests_runtime.out`: Added multiple test cases to verify collation behavior with various sort and order by operations, including case sensitivity and numeric ordering. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4014123 |
||
|
|
2d56e59c69 |
Merged PR 1674853: Add support for nested regex in nin operator for composite index
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Add support for nested regex in nin operator for composite index ---- #### AI description (iteration 1) #### PR Classification This pull request is a feature enhancement that adds support for nested regex patterns in the $nin operator for composite indexes. #### PR Summary The changes update the composite index code to correctly handle nested regex within the $nin operator by passing a new negation flag to various functions and adjusting bound calculations accordingly. Additionally, the pull request updates several expected output files and tests (both SQL and error/explain tests) to reflect the new behavior. - Updated `/oss/pg_documentdb/src/opclass/bson_gin_composite_core.c` functions (e.g. `SetSingleRangeBoundsFromStrategy`, `AddMultiBoundaryForDollarRegex`) to accept and act on a new `isNegationOp` flag for regex bounds. - Modified `/oss/pg_documentdb/include/query/bson_dollar_operators.h` to include an `isNegationOperator` field in the `RegexData` struct. - Revised test files (SQL scripts, expected output files in both distributed and pgmongo directories) to add and validate queries with regex patterns in both $in and $nin operators. - Adjusted several functions such as `ParseOperatorStrategy` and related boundary-setting functions to propagate the negation flag accurately. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
ad80606fda |
Merged PR 1668461: Disable force index pushdown for $geoNear queries
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Other ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes: documentdb.enable_force_push_geonear_index ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description - $geoNear is always forced pushed to geospatial index and it can make few queries not perfrom well e.g when there are other condition that can potentially use the rum index to perform better. With this PR a GUC is introduced to disable force pushdown of geonear queries ---- #### AI description (iteration 1) #### PR Classification This pull request implements a bug fix to disable force index pushdown for $geoNear queries based on a runtime GUC setting. #### PR Summary The changes adjust the index pushdown logic so that geonear queries can be conditionally routed based on the new configuration flag. This enhancement supports accurate geospatial query planning when the GUC is disabled. - `oss/pg_documentdb/src/opclass/index_support.c`: Added new functions and modified the force index pushdown logic to check the `EnableGeonearForceIndexPushdown` flag. - `oss/internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_geonear.out` and `pgmongo/src/test/docdb_compat/expected/bson_aggregation_pipeline_tests_geonear.out`: Introduced tests to verify runtime behavior with the GUC disabled. - `oss/internal/pg_documentdb_distributed/src/test/regress/sql/bson_aggregation_pipeline_tests_geonear.sql`: Updated SQL tests to exercise both scenarios for geonear queries. - `oss/pg_documentdb/src/configs/feature_flag_configs.c`: Defined a new GUC (`enable_force_push_geonear_index`) to control the pushdown behavior. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4197512 |
||
|
|
e500aa3e42 |
Merged PR 1678009: Delete intermediate extensions from the repo
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Refactor ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Delete the intermediate staging extensions that were used initially for OSS now that we have the real OSS extensions. Inluded SQL files are left for back-compat for old SQL files. ---- #### AI description (iteration 1) #### PR Classification This pull request performs a code cleanup by deprecating and removing intermediate extensions. #### PR Summary This PR removes various intermediate extension modules and their associated files from the repository, along with updates to the build configuration to eliminate references to these deprecated components. - Removed multiple files in `helio_api/pg_helio_api` (SQL scripts, C source files, control file, and Makefile). - Removed files in `helio_api/pg_helio_core` (C source, SQL upgrade scripts, control file, and Makefile). - Removed files in `helio_api/pg_helio_distributed` (C source, SQL scripts, control file, and Makefile). - Updated `/pgmongo/Makefile` and `/pgmongo/src/pgmongo.c` to remove helio extension dependencies and related flags. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
4d0ed51594 |
Merged PR 1677550: Create indexes inline for create collection
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? Yes ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description If we created the collection in the same command as create indexes, then we don't need to queue it to the index queue - we can just create it since we know we have the lock on the table and it's empty. Make index builds for created tables faster. ---- #### AI description (iteration 1) #### PR Classification This PR introduces a new feature enhancing the index creation process by building indexes inline when a collection is created. #### PR Summary The changes modify the index creation flow to build indexes immediately in the same transaction if the collection is created automatically. This improves efficiency and consistency by reducing asynchronous operations. - `src/commands/create_indexes_background.c`: Added conditional logic to build indexes inline using `create_indexes_non_concurrently` when `createdCollectionAutomatically` is true and the inline creation is not skipped. - `src/configs/feature_flag_configs.c`: Introduced the `SkipCreateIndexesOnCreateCollection` boolean flag to control whether indexes should be created inline during collection creation. - Test output files in various directories were updated to reflect the new behavior by simplifying the index request details in the expected results. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
b1d5b3bbab |
Merged PR 1675095: [Gateway][Rust] Eliminate client terminology for postgres connection and connection pools
### Does this PR have any customer impact? no ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) refactoring ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) no ### Are you introducing any new config? If yes, do you have tests with and without them being set? no ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Refactor Rust gw to eliminate client terminology when it comes down to postgres connections 1. There were too many "clients" that in fact were nothing else than a postgres connection, either done by us (renamed to Connection type) or a raw connection from deadpool crate, so to make my further changes more readable I'm doing this refactoring as a required step 2. I've introduced a separate connection pool for auth requests as we had it combined before, so in case one connection pool is throttled the other conn pool works 3. Update dev utils such as rust analyzer to index over the oss project and update the git hooks 4. update ADO pipeline to include clippy and cargo fmt for OSS ---- #### AI description (iteration 1) #### PR Classification This pull request is a refactoring update that replaces “client” terminology with “connection” to implement global postgres connection pooling in the Rust gateway. #### PR Summary The changes update naming and method calls to provide feature parity with a global postgres connection pool, standardizing connection handling across the codebase. - In files under `/oss/pg_documentdb_gw/src/processor/`, functions now use `Connection` and `pull_connection` instead of `Client` and `pg`, updating transactional and cursor operations accordingly. - In `/oss/pg_documentdb_gw/src/postgres/client.rs` and related modules, `Client` is renamed to `Connection` and `Pool` to `ConnectionPool` with adjusted internal method calls. - In `/oss/pg_documentdb_gw/src/context/`, connection acquisition functions and error messages are updated to reflect the new connection terminology. - In `/gateway/native/src/main.rs` and `/gateway/native/tests/common/mod.rs`, the global connection pool instantiation is revised, and the file `dataapi.rs` is moved and renamed to `data_api.rs`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #3666511 |
||
|
|
7c3ca23705 |
Merged PR 1549599: [mongo 8.0] support option sort in updateOne
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description support sort option in command updateOne(mongo 8.0) ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for sorting in the `updateOne` operation. - `update.c`: Added handling for the `sort` field in the `updateOne` parameters. - `commands_update.sql` and `commands_update.out`: Added tests to verify the new sorting functionality in `updateOne`. |
||
|
|
8261e772f4 |
Merged PR 1672946: [Update] Make update parsing cheaper
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Perf ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Currently for Update/Delete, we currently parse the update spec, query spec, etc into pgbsons on startup. Then reuse it per commands. This has a few issues - for large document requests, this causes us to duplicate memory and persist it for the duration of the update and also transcode all up front - this is worse for multi-node when all we need to do is build yet another update spec and push it to the worker. Instead, we now only cache pointers to the spec document; then when we need it we convert to pgbson only if necessary. A consequence of this is that on a single node update, if we're doing a simple updateOne on _id then we would never serialize the updateSpec at all (for instance). We also more eagerly free memory on the intermediate update specs. ---- #### AI description (iteration 1) #### PR Classification Performance optimization for update parsing by refactoring BSON value handling. #### PR Summary This PR streamlines update parsing by replacing heavy BSON initialization routines with lightweight wrappers and converting update-related types from `pgbson*` to `bson_value_t*`, which reduces overhead and improves coordinator/worker compatibility. - `src/commands/update.c`: Replaced multiple `PgbsonInitFromDocumentBsonValue` and similar calls with efficient wrappers like `CreateBsonValueFrom` and updated serialization (including back-compatible array filter and update document formats). - `include/commands/update.h`: Updated update structure fields to use `bson_value_t*` instead of `pgbson*`, aligning interfaces with the new parsing approach. - `src/update/bson_update.c` and `bson_update_operators_workflow.c`: Refactored update type determination and replace document logic to use new BSON value iterators and helper functions. - Other modules (e.g. `commands/find_and_modify.c`, `commands/delete.c`, query operators, sharding) were updated to leverage the lighter-weight BSON representation and its associated helper routines. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
f63bc316ac |
Merged PR 1663053: Enable composite opclass on more tests and fix NaN handling in the index
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description This fixes the handling of NaN in the new composite index op class and also enables more testing using the op class. |
||
|
|
1fd2daa2e6 |
Merged PR 1672196: Fix Lookup Unwind Crash with Inner join
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) BugFix ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description - When unwind is used with preserveNullAndEmptyArrays: false, the join type is used as INNER JOIN, but we have the join defined as LATERAL which means it is dependent on results of left query. The bug seems to be intermittent based on the cost of the joins, sometimes the join can be evaluated as LEFT JOIN RIGHT where things work, but when PG decided to go to the path of RIGHT JOIN LEFT it will crash as RIGHT is dependent on LEFT The solution is to always use LEFT JOIN, and for case where `preserveNullAndEmptyArrays: false` add an `IS NOT NULL` check to filter out the right documents that are not a match. ---- #### AI description (iteration 1) #### PR Classification This pull request fixes a bug in lookup unwind operations by correcting the join type used in the aggregation pipeline. #### PR Summary The changes resolve a crash caused by using an inner join during lookup unwind by refactoring the join logic and lookup context. The update enforces LEFT JOIN behavior when preserving null and empty arrays and updates test expectations accordingly. - `oss/pg_documentdb/src/aggregation/bson_aggregation_nested_pipeline.c`: Refactored the lookup join logic by replacing the `useInnerJoin` flag with the `preserveNullAndEmptyArrays` flag and always using LEFT JOIN. - `pgmongo/src/test/docdb_compat/expected/bson_aggregation_stage_lookup_tests.out` and `oss/internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_stage_lookup_tests.out`: Updated expected outputs for BSON aggregation lookup tests. - `oss/internal/pg_documentdb_distributed/src/test/regress/sql/bson_aggregation_stage_lookup_tests.sql`: Added new SQL tests to verify the corrected lookup behavior using LEFT JOIN. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4209808 |
||
|
|
837aa3eef8 |
Merged PR 1671663: Change the way to fix postgis 3.5 building
Optimize the fix for postgis 3.5 Related postgis issue: https://trac.osgeo.org/postgis/ticket/5652 ---- This pull request is a bug fix that updates the PostGIS 3.5 build process. The changes modify the installation script and update Docker container configurations to resolve build issues for PostGIS 3.5 by removing unused GDAL components and avoiding parallel build race conditions. - `oss/scripts/install_setup_postgis.sh`: Added a call to `./autogen.sh`, updated configuration options by removing GDAL use and adding `--without-raster`, and replaced parallel `make` with serial execution. - Multiple Dockerfiles (`.pipelines/Containers/Container-Base-Mariner/Dockerfile`, `/.devcontainer/Dockerfile`, `/.pipelines/Containers/Container-Base-Ubuntu/Dockerfile`, `/oss/.devcontainer/Dockerfile`, and `/oss/.github/containers/Build-Ubuntu/Dockerfile`): Removed GDAL development dependencies to align with the updated build process. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
1c70706354 |
Merged PR 1671459: [Cleanup] Removing Unnecessary variable
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description [Cleanup] Removing Unnecessary variable |
||
|
|
a2876ad93a |
Merged PR 1644508: [Compact] GW plumbing for the compact command support
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description GW plumbing of compact command 1- Route the compact command to the backend. 2- Add a dummy C handler function for `compact` that does nothing and throws the same error. Next PR is going to add support for compact in the backend with blocking writes by running VACUUM FULL ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for the `compact` command in the MongoDB Postgres runtime. - Added `CompactAsync` method in `PostgresClient.cs` to handle the compact command. - Implemented `command_compact` function in the new file `compact.c`. - Updated `PostgresMongoClient.cs` to include the `CompactAsync` method. - Modified `MongoRequestParser.cs` to parse the compact command. - Added SQL function definitions for the compact command in `compact--0.103-0.sql` and `compact--latest.sql`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
8233bf2fb3 |
Merged PR 1661768: [Perf] Write Optimization for new tables. Creating new tables with 3 columns
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description 1. Creating New tables without creation_time column. This under a GUC. 2. support of 4 col table as well as 3 col table in all code path. ---- #### AI description (iteration 1) #### PR Classification Performance optimization for creating new tables with three columns. #### PR Summary This pull request introduces performance improvements for creating new tables with three columns in the document database. It includes tests for operations on both three-column and four-column tables. - Added `three_column_data_table.out` to test the creation and operations on tables with three columns, including insert, update, and aggregate operations. - Demonstrated the use of GUC (Grand Unified Configuration) to enable and disable creation time for data tables, affecting table operations. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |