Commit Graph
769 Commits
Author SHA1 Message Date
Vinod Sridharan c5bbda3241 Merged PR 1668237: [Livesite] Handle default_readonly_transaction more gracefully
### 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

When servers have default_readonly_transaction set, the current behavior is wonky - it will cause failures in underlying queries and pollute the errors, and it will go through a bunch of work only to fail.
Additionally, background jobs like TTL will fail ungracefully.

Handle this GUC by failing write commands early with a more useful error message.
Additionally, in cases like TTL, add an opt-in way to prune rows even in the presence of this GUC if it's opted into.

----
#### AI description  (iteration 1)
#### PR Classification
This pull request is a bug fix that improves error handling for write operations attempted during default read-only transactions.

#### PR Summary
The changes introduce a unified mechanism to check and enforce read-only transaction restrictions, ensuring graceful errors when write operations are attempted while in a read-only state. Key changes include:
- **`include/commands/commands_common.h`**: Added the inline function `ThrowIfServerOrTransactionReadOnly` to validate transaction state and throw appropriate errors.
- **Test files**: New regression tests under `/oss/pg_documentdb/src/test/regress/expected/` and `/oss/pg_documentdb/src/test/regress/sql/readonly_transaction_tests.sql` validate the expected error responses under read-only conditions.
- **`ttl_index.c`**: Modified TTL job logic to handle read-only transactions, allowing jobs to commit and restart when the corresponding flag is enabled.
- **Gateway and error handling**: Updated configuration in `TenantConfigurationBase.cs`, error augmentation in `PostgresMongoResultExtensions.cs`, and error mappings (e.g., adding error code 10107 for `NotWritablePrimary`) to propagate clear error messages.
- **Command modules**: Added calls to `ThrowIfServerOrTransactionReadOnly` in several command implementations (e.g., in `insert.c`, `update.c`, `delete.c`, `create_indexes.c`) to enforce read-only restrictions uniformly.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-29 12:12:31 +08:00
Guanzhou Song 047561b03e Change Image Name and Tag for doc (#203)
Fixes a Doc Bug where we accidentally gave the preview tag instead of the latest one.
2025-05-28 10:59:54 -07:00
yangqiaoandroot c1c482d438 update (#197)
Co-authored-by: root <root@CPC-yangq-FRSGK>
2025-05-23 15:33:07 +08:00
Avijit Gupta a8f90aa074 Update CHANGELOG.md (#184) 2025-05-21 13:47:53 +05:30
Guanzhou Song 76323e7d0b * Add public documentdb-local Docker image with gateway to GHCR (#193) 2025-05-20 10:16:07 -07:00
Guanzhou Songandsajeetharan 5c240146b1 Add Documentations and Deployment Workflow (#187)
* Add doc site

* update deploy workflow

* add gateway doc

* update structure and add gateway doc

* update missing image

---------

Co-authored-by: sajeetharan <sajeetharan@outlook.com>
2025-05-20 11:20:17 -04:00
Guanzhou Song 720e8725dd Fix user id for k8s operator (#190) 2025-05-16 16:45:29 -04:00
Guanzhou Song 30572d9ddf Add Steps in GIthub Action to Sign the Docker Image and Workflow to Release (#183)
* Add steps to sign the docker image

* clean up

* add workflow to release latest manifest

* release

* manual trigger

* trigger

* update

* update

* create
2025-05-14 23:43:44 -04:00
Guanzhou Song b2080caee5 Add Gateway Integration (#166)
* init

* fix

* revert

* Create docker-image.yml

* Update docker-image.yml

* Update docker-image.yml

* set image

* clean up

* image tag and build

* typo

* fix naming

* rename

* arm64

* add arm64

* update

* set default data path

* generate cert files in start up scripts

* set up for cloud native PG

* init

* gateway

* using ENV to set arguments

* remove password

* set name

* add citus back

* update trigger

* push to GHCR

* generate manifest to GHCR

* update image name

* Revert "update image name"

This reverts commit 0279d40a56adce11920f512854190c19edfaa13b.

* rename

* rename

* set image name and tags

* set input for manifest tag

* make documentdb version configurable

* add port check

* use matrix for clearance

* set default value

* set env
2025-05-12 10:38:55 -04:00
shuaitian aaa5795d9d fix scram by setting keyLength 2025-05-09 14:08:53 +08:00
shuaitian 916a6b423f use 3.5.2 and install raster 2025-05-09 14:08:53 +08:00
shuaitian 9002cc7ecf fix flaky sql test pipeline 2025-05-09 14:08:53 +08:00
shuaitian c4834aea38 DocumentDB sync sha=d933c3930 2025-05-09 14:08:53 +08:00
Lei Jiang 4e131e6b43 Merged PR 1664574: [r/o user] Updated CHANGELOG.md to move feature to 104 release
### Does this PR have any customer impact?
No, changelog only

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Doc change

### 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))
Modified

### Description

Updated CHANGELOG.md to move feature to 104 release

----
#### AI description  (iteration 1)
#### PR Classification
Documentation update.

#### PR Summary
This pull request updates the `CHANGELOG.md` to correctly categorize a feature under the appropriate release version.
- `CHANGELOG.md`: Moved the feature "Enable user CRUD by default and disable read-only user GUC check" from the unreleased section to the 104 release section.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Deepak Bisht 8b7b93ced7 Merged PR 1578129: [Pending release cut 1.102]- Fix projection with bson_dollar_merge_documents for multiple scrnarios
### 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)
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))
Bugfix to override nested arrays in dotted path in `bson_dollar_merge_documents` UDF for few cases

### Description
bson_dollar_merge_documents function today recurses into nested arrays always and project in each element of array but that is not correct with mongo semantics.

This is only applicable if the projectetion is a dotted path.

The function is used in 7 different stages/features today:

1- list_collection: no dotted paths for projection, so this is okay to follow any projection.
2- graphlookup: Mongo does a shallow projection in this case.
3- lookup: Mongo does a shallow projection in this case.
4- inverseMatch: okay as no dotted path projection
5- count: okay as no dotted path projection
6- group : okay as no dotted paths are allowed
7- setWindowFields: only this stage does a full projection even inside nested arrays

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
This pull request addresses multiple scenarios for fixing projection with `bson_dollar_merge_documents`.
- Added new functions in `oss/pg_documentdb/sql/udfs/projection/bson_projection--0.102-0.sql` to handle various BSON document operations.
- Updated `bson_dollar_merge_documents` function to include an `overrideArray` parameter.
- Modified test expectations in `oss/internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_graphlookup.out` to reflect changes in the `bson_dollar_merge_documents` function.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Parag Jain 45c6233365 Merged PR 1663686: Bumping citus version to 12.1.7
### 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

Bumoing citus version to 12.1.7

----
#### AI description  (iteration 1)
#### PR Classification
Version update.

#### PR Summary
This pull request updates the Citus version from 12.1.6 to 12.1.7, ensuring the project uses the latest stable release.
- Updated `CITUS_VERSION` in `/oss/scripts/setup_versions.sh` to `v12.1.7`.
- Updated `commitHash` in `/cgmanifest.json` to match the new Citus version.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4170021
2025-05-09 14:08:53 +08:00
Amit Prabhudesai 84ba0c99d8 Merged PR 1572685: [OSS] Fix background index builds for documentdb
### 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)
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
Get background index builds to work for single-node documentdb.

This changeset fixes background index builds for OSS by:

1. Scheduling the background index build tasks
2. Moving the distributed functionality (which had not being refactored out of the indexing code during the move to OSS) into distributed hooks, with the base implementation for single-node.
3. Refactoring SQL tests to get even with the above changes.

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix for background index builds in DocumentDB.

#### PR Summary
This pull request addresses issues with background index builds in DocumentDB by adding comprehensive tests and handling various edge cases.
- `commands_create_indexes_background.out`: Added extensive test cases to validate the behavior of `create_indexes_background` function, including handling of invalid inputs, unique constraints, and various index specifications.
- Introduced a new schema and function to manage index job statuses.
- Enhanced error handling and validation for index creation requests, ensuring proper error messages and statuses are returned for invalid operations.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Cornelius Boateng f6a67cec94 Merged PR 1654888: [engine][collation] Support for $indexOfArray
### Does this PR have any customer impact? No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) No

### 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 collation with `$indexOfArray`

 `$indexOfBytes, $indexOfCP, $strcasecmp` are collation-agnostic. They do not respect collation.

`$let` and `$zip` respect collation.
----
#### AI description  (iteration 1)
#### PR Classification
New feature: This pull request adds support for collation in string and array operators, specifically for `$indexOfBytes`, `$indexOfCP`, and `$indexOfArray`.

#### PR Summary
This pull request introduces collation support to enhance string and array operations, allowing for locale-aware comparisons in `$indexOfBytes`, `$indexOfCP`, and `$indexOfArray` operators.
- Modified `bson_expression_string_operators.c` to include collation handling in string comparison functions and updated function signatures to accept collation strings.
- Updated `bson_expression_array_operators.c` to support collation in array index operations, including changes to function signatures and argument handling.
- Introduced new structures `StringCompareArguments` and `IndexOfArrayArguments` to manage collation strings and arguments for the respective operations.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Lei Jiang effb319509 Merged PR 1656996: [r/o users] Enable enableUserCrud flag by default on oss/pgdocument_db
### Does this PR have any customer impact?
Yes, on Flex clusters the enableUserCrud flag is set to true by default, while hard set to false for Marlin

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Default setting change on top of the 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?
Not a new config.

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
Added a line in CHANGELOG.md

### Description
The changes in this PR do the following:
1. Set the default enableUserCrud to true and move it to system config (from feature config);
2. Added a config file pgmongo_postgres_marlin_userconfig.conf to hard set it to false for Marlin

Once deployed, GW team will do a manual validation on FLex and Marlin clusters respectively.

----
#### AI description  (iteration 1)
#### PR Classification
Configuration change to enable a feature flag by default.

#### PR Summary
This pull request enables the `enableUserCrud` feature flag by default in the OSS/pg_documentdb project, impacting how user CRUD operations are handled.
- Removed the `enableUserCrud` flag definition from `feature_flag_configs.c` and added it to `system_configs.c` with a default value of `true`.
- Updated `scripts/utils.sh` to remove the explicit enabling of `enableUserCrud`.
- Added a new configuration file `pgmongo_postgres_marlin_userconfig.conf` to manage user-configurable settings.
- Updated `CHANGELOG.md` to reflect the change of enabling user CRUD by default.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Vinod Sridharan 1153e6b6ac Merged PR 1661728: [Performance] Read & Query Perf Wave 2
### 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?
Yes
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description

1) In the Gateway, when preparing queries, embed the commandKey and userOid. That way a given prepared query is unique for a given user and command. This can be used for a future optimization to cache ACL check results
2) Reduce serialization costs from GW -> BE: Don't send the database name in the query. This is already in the request as a '$db' field. Support suppressing this (add a GUC to rollback just in case)
3) In the backend start parsing the $db if it's not sent by the GW
4) From the commandFuncs -> Query we were going through a layer of fmgr. We don't need this. Instead call directly into the functions in C to avoid the fmgr overhead. Additionally for GetMore this means we don't need to repack the heap tuple.

As part of this we discovered that registering functions in pg_dist_object can regress perf for dispatch functions. Add a test to validate which ones of these are public.

----
#### AI description  (iteration 1)
#### PR Classification
Performance improvement.

#### PR Summary
This pull request focuses on enhancing the performance of read and query operations by optimizing function calls and parameter handling.
- Refactored `ExecuteQueryCore` in `command_funcs.c` to improve query execution by directly calling specific functions and adding ACL checks.
- Changed function signatures in `bson_aggregation_pipeline.h` to use `text` instead of `Datum` for database parameters, improving type consistency.
- Added `aggregation_commands.h` to export new aggregation command functions.
- Updated `PostgresClient.cs` to conditionally include database names in query parameters, enhancing query flexibility.
- Introduced new configuration option `SendDatabaseNameInParams` in `PostgresTenantConfiguration.cs` to control database name parameterization.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Deepak Pemmaraju b89df263a0 Merged PR 1661186: changing max users to 100
### 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

changing max users to 100

----
#### AI description  (iteration 1)
#### PR Classification
Configuration change to adjust system limits.

#### PR Summary
This pull request reduces the maximum user limit in the system configuration from 500 to 100.
- `system_configs.c`: Changed `MAX_USER_LIMIT` from 500 to 100.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Vinod Sridharan 58d0dfae08 Merged PR 1660651: [Perf] Miscellaneous Read Perf Improvements
### 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?
Yes

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
A few miscellaneous perf changes focused on Point reads
1) When parsing the find spec, we do a bunch of if/elses which means we're doing 10ish ifs for the keys that are lower in the if. Use a switch and dispatch on the first character to speed this up
2) When doing a point read and local execution, we can skip setting up yet another Portal and Transaction since we're already in a func context and we can leverage the same snapshot for the reads. Also we don't need to hold a SPI Destination and copy it to the target pgbson_array_writer, use a custom DestReceiver that takes hte Tuple and directly writes it to the target.
3) Cleanup the Gateway Dispatch functions and remove an unnecessary PG_TRY/PG_FINALLY (this is already handled by PG).

----
#### AI description  (iteration 1)
#### PR Classification
Performance improvement.

#### PR Summary
This pull request introduces various performance enhancements to the read operations in the codebase, focusing on optimizing BSON aggregation and cursor handling.
- `bson_aggregation_pipeline.c`: Refactored the `GenerateFindQuery` function to use a switch-case structure for improved performance and readability.
- `cursors.c`: Added new functions `DrainStatementViaExecutor` and `DrainStatementViaPortal` to optimize query execution and result handling.
- `command_funcs.c`: Simplified argument handling in `HelioExternalFunctionCall` and introduced `DoAclCheck` for access control.
- `PostgresMongoCursorBuilder.BackendCursor.cs`: Simplified cursor page statement generation by removing unnecessary parameters.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Cornelius Boateng f6d20fbf8a Merged PR 1646920: [engine][collation] Support for Arrays and Documents
### 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 collation with comparison of `array` and `document` values.
Also adds support for `$in` on nested arrays and documents.

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Adds support for collation-aware hashing of arrays and documents in BSON.

#### PR Summary
This pull request introduces collation-aware hashing for BSON arrays and documents, enhancing the handling of collation in hash sets. It refactors existing hash functions to accommodate collation strings and recursive hashing of nested BSON structures.
- `hashset_utils.c`: Implements collation-aware hashing functions for BSON values, including recursive handling of arrays and documents.
- `bson_expression_set_operators.c`: Replaces existing hash set creation with collation-aware hash set creation.
- `bson_dollar_operators.c`: Updates logic to use collation-aware hash sets for `$in` queries, removing unsupported scenarios.
- `hashset_utils.h`: Adds a new struct `BsonValueHashEntry` to store BSON values with collation strings.
- `collation.h`: Moves `IsBsonTypeCollationAware` function to handle collation applicability checks.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4111861, #4115239
2025-05-09 14:08:53 +08:00
Vinod Sridharan efa2b802f6 Merged PR 1659003: [Composite OpClass] Enable Runtime Functions and add test coverage
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature/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?
Yes
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
Fix up runtime index recheck function support to reduce loading documents.
This should reduce the number of runtime rechecks that are needed for documents and trust the index more as we will evaluate these clauses directly on the index first.

Also add option to trigger jstest coverage for the new opclass - and set them to run on the MX jstests - this is still disabled right now since there are some failing tests but will be enabled separately.

----
#### AI description  (iteration 1)
#### PR Classification
New feature: This pull request introduces runtime functions for composite index operations and enhances test coverage.

#### PR Summary
This pull request enables runtime functions for composite index operations, improving the flexibility and efficiency of index handling. It also adds test coverage to ensure the reliability of these new features.
- `bson_gin_composite_entrypoint.c`: Refactored comparison logic to support runtime functions for index rechecks.
- `bson_gin_composite_core.c`: Implemented `IsValidForIndexValue` function to handle various BSON index strategies with runtime rechecks.
- `create_indexes.c`: Modified index creation logic to conditionally enable new composite index opclass based on configuration.
- `bson_gin_composite_private.h`: Added `IndexRecheckArgs` structure to support runtime recheck strategies.
- `testing_configs.c`: Introduced configuration options for enabling the new composite index opclass by default.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Deepak Bisht 535e5713ba Merged PR 1660646: [Bug Fix] [Point Read Path] - Add permission info on planned statements for PG > 16
### 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

- The asserts enabled build fails for missing permsInfo on planned statement, add it while creating the Point read plan

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix: Add permission information to planned statements for PostgreSQL versions greater than 16.

#### PR Summary
This pull request addresses a bug in the point read path by adding permission information to planned statements for PostgreSQL versions 16 and above. This change is part of optimizing the read hotpath as per the linked work item.
- In `/oss/pg_documentdb/src/planner/documents_custom_planner.c`, added `permInfos` to the planned statement for PostgreSQL versions 16 and above.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4157027
2025-05-09 14:08:53 +08:00
Deepak Bisht cd19288dbc Merged PR 1647200: [Perf]- Point read improvement, remove PG inference of type and create the tuple descriptor directly
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Perf

### 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

- add cursor result type for UDFs, this helps PG to not always try to figure out the `OUT` variables and form a tuple descriptor

![image.png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1647200/attachments/image.png)

----
#### AI description  (iteration 1)
#### PR Classification
Performance improvement and API change.

#### PR Summary
This pull request introduces performance improvements for point reads by adding a new cursor type for SQL functions. It modifies existing functions to return a structured type instead of a record, enhancing efficiency and clarity.
- `query_cursors_aggregate--latest.sql`: Added `cursor_result` type and updated several functions to return this type instead of a record.
- `query_cursors_aggregate--0.103-0.sql`: Newly added file with similar changes as `query_cursors_aggregate--latest.sql`.
- `documentdb--0.102-1--0.103-0.sql` and `pgmongo--1.102-1--1.103-0.sql`: Updated to include the new `query_cursors_aggregate--0.103-0.sql` file.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4157027
2025-05-09 14:08:53 +08:00
Vinod Sridharan 2eb9573add Merged PR 1659401: [Infra] Enable diskann on pg17
### 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
Now that diskann supports Pg17, enable consumption of diskann in pg17.

----
#### AI description  (iteration 1)
#### PR Classification
Infrastructure update to enable the `diskann` extension on PostgreSQL 17.

#### PR Summary
This pull request removes previous restrictions and enables the `diskann` extension to be built and packaged for PostgreSQL 17, addressing compatibility issues.
- Removed conditional checks in `oid_cache.c` and `process_utility_hook.c` that prevented `diskann` support for PG17.
- Updated `pipeline_create_setup_packages.sh` and `install_setup_pg_diskann.sh` to allow packaging and installation of `pg_diskann` for PG17.
- Modified `pipeline_build_extension_core.sh` to remove PG17-specific build skips for `diskann`.
- Adjusted test configurations in `test_mutate_17` by removing specific test skips related to `diskann`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Zinan Ren ac6f028c86 Merged PR 1653287: [Vector Search] Enable iterative index scans for HNSW and IVF in filtering searches
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
With the release of [pgvector 0.8.0](https://github.com/pgvector/pgvector/tree/5bc7937715c67add21c8bcc0d4284162c7a0174f?tab=readme-ov-file#iterative-index-scans), which supports iterative scan for HNSW and IVF, we enable it in filtering search to support pre-filtering(currently it is post-filtering)
- Pass the new parameter "iterativeScan" through the function bson_search_param from the coordinator to the worker.
Example : { "efSearch" : 10, "iterativeScan" : "relaxed_order"}
- Enable iterative scan for hnsw/ivf index on workers:
SET LOCAL  hnsw.iterative_scan = relaxed_order;
SET LOCAL  ivfflat.iterative_scan = relaxed_order;
relaxed_order by default, which allows results to be slightly out of order by distance, but provides better recall.
After iterative search, re-ordering will be applied to the results.
- Set iterative scan for diskann index to relaxed_order
SET LOCAL  diskann.iterative_search = relaxed_order;
- Check the availability of iterative scan in pgvector
The pgvector iterative scan is available from version 0.8.0. Currently, if the pgvector extension has not been upgraded to 0.8.0, the iterative scan will be disabled in those clusters until pgvector is upgraded to 0.8.0.

###Related GUCs
**documentdb.vectorPreFilterIterativeScanMode**: enable iterative index scans, which will automatically scan more of the index until enough results are found (relaxed_order by default)
- off, disable iterative scan
- relaxed_order,  allows results to be slightly out of order by distance, but provides better recall
- strict_order, ensures results are in the exact order by distance

####GUCs from pgvector
**hnsw.max_scan_tuples**: Specify the max number of tuples to visit (20,000 by default)
**hnsw.scan_mem_multiplier**: Specify the max amount of memory to use, as a multiple of work_mem (1 by default)
**ivfflat.max_probes**: Specify the max number of probes(32768 by default)

###Mongo Command(no change in this PR)
```
db.testing_hnsw_vector_collection.aggregate(
[
  {
    "$search": {
	  "cosmosSearch": {
        "vector": [ 3.0, 4.9, 1.0 ],
        "path": "vect",
        "filter": {"meta.a": [ { "b" : 3 } ]},
        "k": 4,
        "efSearch": 100
      },
    }
  },
  {
    "$project": {
      "rank": {
        "$floor": [{"$multiply": [{ "$meta": "searchScore"},100000]}]
      }
    }
  }
])
```

----
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request introduces iterative index scans for HNSW and IVF in filtering searches, enhancing the pre-filtering capabilities of vector searches...
2025-05-09 14:08:53 +08:00
Ritvik Jayaswal 7c8dede426 Merged PR 1649466: Moved Cipher Map out of OSS
### 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

Moved Cipher Map out of OSS. The cipher map is needed for internal logging purposes only so it is moved to the native gateway and moved out of the OSS gateway.

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup and refactoring.

#### PR Summary
This pull request refactors the code by moving the cipher list out of the open-source section of the codebase, as it is only used for telemetry purposes.
- Added `get_cipher_type` function in `gateway/native/src/main.rs` to handle cipher mapping.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4053610
2025-05-09 14:08:53 +08:00
Alexander Laye b0163d28ee Merged PR 1657533: Add line to changelog for pg_documentdb_gw
### Does this PR have any customer impact?

No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)

Documentation

### 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))

Push pg_documentdb_gw for documentdb connections

### Description

add line to changelog

----
#### AI description  (iteration 1)
#### PR Classification
Documentation update.

#### PR Summary
This pull request updates the changelog to include a new feature related to `pg_documentdb_gw`.
- Updated `/oss/CHANGELOG.md` to document the addition of `pg_documentdb_gw` for DocumentDB connections.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Zinan Ren f602705f11 Merged PR 1658397: [Vector Search] Enable prefiltering by default
### 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

Set default prefilter feature flag to true

----
#### AI description  (iteration 1)
#### PR Classification
Enable prefiltering by default for vector search, addressing the iterative filtering search work item.

#### PR Summary
This pull request modifies the vector search functionality to enable prefiltering by default, optimizing query execution by utilizing index scans instead of sequential scans and sorting. This change is expected to improve performance and efficiency in vector search operations.
- Changes in `/pgmongo/src/test/docdb_compat/expected/bson_aggregation_pipeline_tests_vector_hnsw_planner.out`: Replaced sequential scans and sorts with index scans for vector search queries.
- Changes in `/oss/internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_vector_mongo.out`: Updated to use index scans, improving query performance.
- Changes in `/pgmongo/src/test/docdb_compat/expected/bson_aggregation_pipeline_tests_vector_mongo.out`: Enabled index-based filtering, replacing unsupported filter errors with index checks.
- Changes in `/oss/internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_vector_ivf.out`: Reduced the number of returned rows by using index scans for vector searches.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #3612471
2025-05-09 14:08:53 +08:00
Jinrui Zhang 356361bceb Merged PR 1628037: Add string case support for '$toDate' operator
### Does this PR have any customer impact?
Yes, by this PR, $toDate could process string case

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Enhancement for exsiting operator

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
N/A

### Are you introducing any new config? If yes, do you have tests with and without them being set?
N/A

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
Add string case support for '$toDate' operator

### Description
Before this PR, `$toDate` could not parse a string to datetime. With this PR, we leverage the ability of `$dateFromString` to finish the support of string case for `$toDate` operator

----
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request adds support for string case conversion in the `$toDate` operator.
- Added `StringToDateWithDefaultFormat` function in `bson_expression_date_operators.c` to handle string to date conversion.
- Updated `ProcessDollarToDate` in `bson_expression_type_operators.c` to utilize the new string conversion function.
- Added tests for string case conversion in `$toDate` operator in `bson_aggregation_type_operators_tests.sql`.
- Updated documentation and release notes to reflect the new feature.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-09 14:08:53 +08:00
Hari Krishna Sunder b896737f53 Do not set collation for bool types 2025-05-02 22:03:09 +08:00
Shuai Tian 43ec71728f Update Dockerfile_build_deb_packages 2025-04-30 17:03:07 +08:00
shuaitian 23286b9bad DocumentDB sync sha=14dcfe3e3 2025-04-30 14:57:09 +08:00
Zinan Ren e05e91ba51 Merged PR 1650017: [Vector Search] Add support for PQ compression in the Diskann 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
Adding support Product Quantization (PQ) compression in vector index, which is a popular method for dramatically compressing high-dimensional vectors to use less memory, and for making nearest-neighbor search faster.
Note: currently, this PQ compression is only supported by the Diskann index.

### Related GUCs
**documentdb.enableVectorCompressionPQ**: Enables vector PQ compression (enabled by default).

### Create index spec:
- **compression**(optional):
  - "half": half-precision vector, which using 16 bits floats.
  - "pq": product quantization compression.

- **pqCompressedDims**(optional): indicates the dimensions after compression. If not specified, it will be automatically calculated based on the original dimensions.
  - Minimum: 1
  - Maximum: 8000

- **pqSampleSize**(optional):Indicates the number of samples PQ uses to generate the initial centroids. The default value is 1000.
  - Minimum: 1000
  - Maximum: 100000

**Note**: It is recommended to create the index after the collection has some data.. If the collection is empty, random vectors within the range [-1, 1] are used to generate the initial centroids and create the index. If the number of documents is less than pqSampleSize, the training data is padded with random data within the range [min, max] from the sampled vector data.

### Command example
```
db.runCommand(
{ "createIndexes": "testing_vector_collection", "indexes":
[{
     "key": { "v": "cosmosSearch" },
     "name": "hsnw_index",
     "cosmosSearchOptions":
     {
         "kind": "vector-diskann",
         "similarity": "L2",
         "dimensions": 1536,
         "compression": "pq",
         "pqCompressedDims": 96,
         "pqSampleSize": 2000
     }
}]
} )
```
### Search spec:
No changes

----
#### AI description  (iteration 1)
#### PR Classification
New feature: This pull request adds support for Product Quantization (PQ) compression in the Diskann index.

#### PR Summary
This pull request introduces support for PQ compression in the Diskann index, enhancing vector search capabilities. It includes error handling for unsupported compression types and validation for PQ parameters.
- Updated `/pgmongo/src/test/regress/expected/bson_aggregation_pipeline_tests_vector_diskann.out` to include tests for PQ compression, error cases, and validation of PQ parameters such as `pqCompressedDims` and `pqSampleSize`.
- Added tests for vector search with PQ compression, including L2, cosine, and IP similarity measures.
- Implemented checks for maximum dimensions and resource limits during PQ index creation.
<!-- GitOpsUserAgent=GitOps.Apps.S...
2025-04-30 14:57:09 +08:00
Deepak Pemmaraju b4c8e88b36 Merged PR 1656246: Changing max user limit to 500
### 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

Changing max user limit to 500

----
#### AI description  (iteration 1)
#### PR Classification
Configuration change to increase the maximum user limit.

#### PR Summary
This pull request increases the maximum user limit from 10 to 500 in the system configuration and related test files.
- Updated `MAX_USER_LIMIT` from 10 to 500 in `/oss/pg_documentdb/src/configs/system_configs.c`.
- Modified `/oss/pg_documentdb/src/test/regress/sql/user_crud_commands.sql` to reflect the new user limit in test cases.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-30 14:57:09 +08:00
William Wang b2624497d9 Merged PR 1633683: Add Support for Username/Password Constraint Validation for DataPlane User CRUD with Extensibility Hooks
### 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 are adding the following constraints for username and password:

**Username**

- The username length must be greater than 0 and less than or equal to 63 characters.

**Password**

- The password length must be between 8 and 256 characters (inclusive).
- The password must satisfy at least 3 of the following 4 conditions:
  - Contains at least one lowercase letter.
  - Contains at least one uppercase letter.
  - Contains at least one digit.
  - Contains at least one special (non-alphanumeric) character.
- The password must not contain any 3-character substring of the username (case-insensitive).

Related work items: #3916282
2025-04-30 14:57:09 +08:00
Parag Jain 6dc1299623 Merged PR 1655272: [FIX] Write Procedure fixes & Enable enableWriteProcedures in pipeline.
### 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
Enabling pgmongo.enableWriteProcedures  In pipeline with fixing issue.
If maxTimeMS is provided we should not run write procedure instead we should use write functions.

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix to improve high concurrency write performance.

#### PR Summary
This pull request addresses performance issues related to high concurrency updates by enabling write procedures and refining transaction handling.
- In `PostgresClient.cs`, added a condition to check for `CommandTimeout` before executing requests with write procedures.
- In `utils.sh`, enabled the `pgmongo.enableWriteProcedures` configuration to support the use of write procedures.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4093126
2025-04-30 14:57:09 +08:00
Manish Gaur c7e25699df Merged PR 1656145: version update for 103 release.
### 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

----
#### AI description  (iteration 1)
#### PR Classification
Version update for the release of version 103.

#### PR Summary
This pull request updates the version numbers across several control files and adds release notes for version 1.103 and 1.104. It also includes changes to SQL files and their corresponding SHA1 checksums.
- `/oss/internal/pg_documentdb_distributed/documentdb_distributed.control`, `/oss/pg_documentdb/documentdb.control`, `/oss/pg_documentdb_core/documentdb_core.control`, and `/pgmongo/pgmongo.control`: Updated default version numbers.
- `/docs/release_notes/pgmongo_1.103.md` and `/docs/release_notes/pgmongo_1.104.md`: Added release notes for versions 1.103 and 1.104.
- `/pgmongo/sql/pgmongo--1.103-1--1.104-1.sql`: Added new SQL file for version transition.
- `/docs/release_notes/toc.yml`: Updated table of contents to include new release notes.
- `/oss/CHANGELOG.md`: Added entry for documentdb v0.104-0.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4140262
2025-04-30 14:57:09 +08:00
Parag Jain 833c4677af Merged PR 1655313: [Cleanup] Removing Insert dead code for old implementation of $out
### 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
Removing Insert dead code

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup

#### PR Summary
This pull request removes dead code related to the `TryInsertOne` function, which is no longer needed in the codebase.
- Removed the `TryInsertOne` function from `src/commands/insert.c`.
- Deleted the `TryInsertOne` function declaration from `include/commands/insert.h`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
v0.103-0
2025-04-30 14:57:09 +08:00
Vinod Sridharan 5a19661e8b Merged PR 1654645: [Feature Flags] Refactoring features and add some tracking
### 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?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
- Add a new section for tracking feature flags
- Add a feature counter to track customers whoc an benefit from the new rum_index_scan.

----
#### AI description  (iteration 1)
#### PR Classification
Refactoring and feature enhancement with added tracking capabilities.

#### PR Summary
This pull request refactors feature flags and introduces new tracking capabilities for feature usage. It reorganizes the feature flag sections and adds new flags for various functionalities.
- Refactored and added new feature flags in `feature_flag_configs.c`, including indexing, planner, and aggregation features.
- Updated `custom_scan_continuation.c` to improve index scan handling and added feature usage reporting.
- Modified `insert.c` to handle snapshot management more effectively.
- Enhanced feature usage tracking in `feature_counter.c` and `feature_counter.h` by adding a new feature counter for index scans with limits.
- Updated test expectations in multiple files to reflect the new feature tracking changes.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-30 14:57:09 +08:00
Vinod Sridharan 1e1a724c3f Merged PR 1654396: [Update procedure] Support Unsharded Remote collections
### 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

For the Update stored procedure for an unsharded collection on a remote node, we would typically delegate the entire request to the worker and process it there.

With a SPROC, we can't delegate the whole thing to the worker. At the same time we can't make it request by request doing RPC to the worker. This change strikes a balance between the two, where we get batches of batchWriteInternalSubTransactionCount (~512) requests, and call update worker with it. Each batch is run as a single transaction on the worker, parsed, evaluated and Commited within the function. And then the outer Sproc commits the whole thing.

This balances between minimizing RPCs and Committing Frequently.

----
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request introduces support for unsharded remote collections in the update procedure, enhancing the functionality of batch updates. Key changes include:
- `update.c`: Added functions to deserialize writer errors and upserted results, serialize update batch parameters, and process batch updates non-transactionally for unsharded collections.
- `commands_update_bulk.out`: Updated expected test outputs to reflect changes in batch update behavior.
- `commands_update_bulk.sql`: Modified SQL tests to disable local writes and test batch update functionality with remote collections.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4093126
2025-04-30 14:57:09 +08:00
Parag Jain 4ed646dfb9 Merged PR 1647233: [Bulk Insert][Perf] support for bulk insert via procedures
### 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
Currently bulk insert run as a function which means that the entire execution runs as a single transaction. Each batch insert is handled as a subtransaction and rolled back to a save point if it fails.
This means that document locks are held for longer, and we can hit limits w.r.t. max documents updated per transaction.
In multi-node setups this also means distributed transactions are held longer causing loss of connection pools.

This change introduces a stored procedure for bulk insert that periodically "Commits" the state to WAL and starts a new transaction. This more mirrors what the non-atomic bulk update is supposed to do. The old function is retained to be used within transactions.

----
#### AI description  (iteration 1)
#### PR Classification
Performance improvement for write commands.

#### PR Summary
This pull request introduces a new procedure for handling write commands, enhancing performance by optimizing user-specific command execution. It includes the addition of new functions and procedures to manage MongoDB operations more efficiently.
- Added new SQL functions and procedures in `/pgmongo/sql/udfs/gateway_funcs/command_funcs--1.103-0.sql` for running commands, queries, DDL, and write operations as a specific user.
- Introduced new insert functions and procedures in `/oss/pg_documentdb/sql/udfs/commands_crud/insert--0.103-0.sql` to handle MongoDB insert operations.
- Implemented `pgmongo_run_write_procedure_as_user` and `ExecuteWriteCommandCore` in `/pgmongo/src/infrastructure/command_funcs.c` to manage write commands with user context.
- Added `CommitOuterInsertTransactions` function in `/oss/pg_documentdb/src/commands/insert.c` to handle transaction commits outside of transaction blocks.
- Introduced a feature flag `EnableWriteProcedure` in `/oss/pg_documentdb/src/configs/feature_flag_configs.c` to control the enabling of write procedures.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-30 14:57:09 +08:00
Zhe Li 2d701fe5ca Merged PR 1651772: [OSS] upgrade rust library
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
dependency library upgrade

### 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

upgrade dependency rust libraries in GW to solve vulnerability alert in github repo.

----
#### AI description  (iteration 1)
#### PR Classification
Dependency upgrade.

#### PR Summary
This pull request upgrades several Rust library dependencies to their latest versions to ensure compatibility and security improvements.
- `Cargo.lock`: Updated versions for multiple packages including `ring`, `cc`, `openssl`, `tokio`, and removed `spin`.
- `Cargo.toml`: Updated `openssl` version from `0.10.64` to `0.10.72`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-30 14:57:09 +08:00
Cornelius Boateng bec1aa3562 Merged PR 1638286: [engine][collation][enhancement] Extend bson_expression_get for collation 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
Add a new bson_expression_get that appends the collationString to the got value, if a valid collationString is passed to it.
This will be used as a helper function to operations that rely on bson_expression_get to pass down collation such as bson_lookup_join_filter.

If no collation string is passed as an arg, we simply return the got value.
----
#### AI description  (iteration 1)
#### PR Classification
New feature to support `$graphLookup` in the engine with collation.

#### PR Summary
This pull request adds support for `$graphLookup` with collation in the engine.
- Added new functions in `oss/pg_documentdb/sql/udfs/aggregation/bson_lookup_functions--0.103-0.sql` for `$graphLookup` operations.
- Modified `oss/pg_documentdb/src/aggregation/bson_aggregation_nested_pipeline.c` to handle collation in `$graphLookup` join filters.
- Updated `oss/pg_documentdb/src/operators/bson_expression.c` to remove collation handling from `bson_expression_get`.
- Added `BsonDollarLookupJoinFilterWithCollationFunctionOid` in `oss/pg_documentdb/src/metadata/metadata_cache.c`.
- Adjusted collation handling in `oss/pg_documentdb/src/query/bson_dollar_operators.c` for `$graphLookup`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4104899
2025-04-30 14:57:09 +08:00
Vinod Sridharan 36bb3e2920 Merged PR 1650400: [Bulk Update] Setup bulk update infrastructure
### 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
Currently bulk updates run as a function which means that the entire execution runs as a single transaction. Each batch update is handled as a subtransaction and rolled back to a save point if it fails.
This means that document locks are held for longer, and we can hit limits w.r.t. max documents updated per transaction.
In multi-node setups this also means distributed transactions are held longer causing loss of connection pools.

This change introduces a stored procedure for bulk update that periodically "Commits" the state to WAL and starts a new transaction. This more mirrors what the non-atomic bulk update is supposed to do. The old function is retained to be used within transactions.

Still TODO:
For unsharded collections in a multi-node setup, we need to send batches of updates to the worker. This is not wired up in this change.

----
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request introduces a new bulk update feature for handling non-transactional updates in the MongoDB wire-protocol. It adds new functions and procedures to support bulk updates and modifies existing update logic to accommodate this new functionality.
- Added `update_bulk` procedure and related functions in `sql/udfs/commands_crud/update--0.103-0.sql` for non-transactional bulk updates.
- Implemented `command_update_bulk` in `src/commands/update.c` to handle bulk updates outside of transactions.
- Enhanced `ProcessBatchUpdateCore` in `src/commands/update.c` to support transactional and non-transactional updates.
- Updated feature tracking in `include/utils/feature_counter.h` and `src/infrastructure/feature_counter.c` to include `FEATURE_COMMAND_UPDATE_BULK`.
- Modified SQL scripts `documentdb--0.102-1--0.103-0.sql` and `pgmongo--1.102-1--1.103-0.sql` to include the new update functionality.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-30 14:57:09 +08:00
yangqiaoandYang Qiao e0c1875c26 Add prebuild image list (#160)
* update readme

* update image list

* update readme

---------

Co-authored-by: Yang Qiao (from Dev Box) <yangqiao@microsoft.com>
2025-04-28 14:00:37 +08:00
Guanzhou Song 802dc9b9af add external access for postgresql as argument (#151) 2025-04-24 13:32:13 +08:00
shuaitian e279ddaacb DocumentDB sync sha=e2f884a55 2025-04-23 12:04:26 +08:00