Commit Graph
290 Commits
Author SHA1 Message Date
Vinod Sridharan 1058640f78 Merged PR 1433699: Updated distributed_hooks.c
### 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

Updated distributed_hooks.c

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup to remove unnecessary include statements.

#### PR Summary
This pull request removes an unused include statement from the `distributed_hooks.c` file to improve code maintainability.
- `distributed_hooks.c`: Removed the unnecessary `#include <distributed/backend_data.h>` statement.
2024-08-17 06:53:59 +03:00
Vinod Sridharan 2afe247964 Merged PR 1432741: Introduce Internal Helio Distributed Extension
### 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)
Yes(ish)

### 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
Introduce pg_helio_distributed for distribution hooks and make pgmongo depend on that.
Also makes the rum_join_scan loading of private rum bits optional

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Introduce Helio Distributed Extension

#### PR Summary
This pull request introduces the Helio Distributed Extension, which adds distributed execution capabilities to the Helio system.
- Removed `shard_colocation.c` from `/pgmongo/src/distribution/` and added `distributed_hooks.c` in `/oss/private/pg_helio_distributed/src/distribution/`.
- Updated `api_hook_impl.c` to use new distributed hooks.
- Added new Makefile and build scripts for the Helio Distributed Extension in `/oss/private/pg_helio_distributed/`.
- Introduced new test validation scripts and configurations in `/oss/private/pg_helio_distributed/src/test/regress/`.
- Updated `pgmongo` Makefile to include the new distributed extension.
2024-08-17 06:53:59 +03:00
Santiago Fernandez Madero 5b54c839f3 Merged PR 1432746: Chmod +x all scripts
### 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

Chmod +x all scripts
2024-08-16 18:24:51 +03:00
Aditya Kotalwar 0135e97ee5 Merged PR 1388730: Enable billing for multiple accounts for 'SOP 009: Enable or Disable billing for an account or subscription'
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
TSG
### 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 change introduces a section in the SOP that includes a script enabling simultaneous updates across multiple accounts under the same subscription.
2024-08-16 18:24:51 +03:00
Vinod Sridharan df3166b074 Merged PR 1428192: Write directly to shard if available
### 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

Write directly to shard if available

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

#### PR Summary
This pull request refactors the shard handling logic to directly write to a shard if available, removing redundant code and simplifying the shard query process.
- `src/api_hook_impl.c`: Simplified shard query logic by removing the `GetShardIdOptimistically` function and optimizing the shard ID retrieval process.
- `src/metadata/collection.c`: Removed the `allowLocalShard` parameter and related logic, streamlining the collection retrieval process.
- `src/aggregation/bson_aggregation_output_pipeline.c` and `src/aggregation/bson_aggregation_pipeline.c`: Updated functions to use the simplified collection retrieval method.
- `include/metadata/collection.h`: Removed the declaration for `GetMongoCollectionOrViewByNameDatumWithLocalShard`.
- `src/helio_api_init.c`: Changed the default value of `UseLocalExecutionShardQueries` to `true`.
2024-08-16 18:24:51 +03:00
Ayush Saluja 516ace4660 Merged PR 1429564: adding support for passing window value in context
### 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

adding support for passing extra window value
This window value is required in individual setWindowField operators like $rank, $denseRank, $locF,
As for each of them we need  a way to check if the windowValue is empty or specifically content
Hence, raising a common pr

----
#### AI description  (iteration 1)
#### PR Classification
New feature: adding support for passing window value in context.

#### PR Summary
This pull request introduces the ability to pass a window value within the context for window aggregation operations.
- `src/aggregation/bson_aggregation_window_operators.c`: Added `windowValue` to the context and updated the order of function calls to include `UpdateWindowAggregationOperator` with the new context.
- `src/aggregation/bson_aggregation_window_operators.c`: Introduced a new field `windowValue` in the `WindowOperatorContext` struct.
2024-08-16 18:24:51 +03:00
Xing Fan ⛳ ee50a64854 Merged PR 1405817: implement $unsetField
### 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

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

### Description
https://www.mongodb.com/docs/manual/reference/operator/aggregation/unsetField/
2024-08-16 18:24:51 +03:00
Zinan Ren 🐾 068a3364ed Merged PR 1400987: [Vector Search][DiskANN Part 1 - Refactoring] To support different index types in oss helio and pgmongo
### Does this PR have any customer impact?
Yes

### 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?
Yes
pgmongo.enableVectorDiskANNIndex: default is off

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

### Description
Refactoring vector search to support different index types in oss helio and pgmongo
### 1. Index type
- helio: vector-ivf, vector-hnsw
- pgmongo: vector-ivf, vector-hnsw, vector-diskann

### 2. Vector index creation
- ParseIndexCreationSpecFunc
- ValidateIndexCreationSpecFunc
- GenerateIndexCreationCmdFunc

### 3. Vector search
- ParseIndexSearchSpecFunc
- ValidateIndexSearchSpecFunc

### 4. Planner and custom scan
- GetIndexAccessMethodOidFunc
- GetSimilarityOpOidByFamilyOidFunc
- SetSearchParametersToGUCFunc
- GetDefaultSearchParamBsonFunc
- CalculateSearchParamBsonFunc

### 5. Test cases
- bson_aggregation_pipeline_tests_vector_diskann
- bson_aggregation_pipeline_tests_vector_hnsw
- bson_aggregation_pipeline_tests_vector_ivf
- bson_aggregation_pipeline_tests_vector_mongo
2024-08-16 18:24:51 +03:00
Vinod Sridharan 17a67446a3 Merged PR 1429304: Improve Delete unsharded Performance
### 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

Dleete unsharded

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

#### PR Summary
This pull request enhances the performance of unsharded delete operations by introducing new serialization and deserialization methods and optimizing batch deletion processing.
- `src/commands/delete.c`: Added `SerializeUnshardedDeletionSpec` and `DeserializeDeleteWorkerSpecForUnsharded` functions to handle unsharded deletions.
- `src/commands/delete.c`: Modified `command_delete_worker` to support unsharded delete operations and improved batch deletion handling.
- `src/helio_api_init.c`: Introduced a new configuration flag `EnableUnshardedBatchDelete`.
- `src/commands/find_and_modify.c`: Updated `CallDeleteOne` to include a `forceInlineWrites` parameter.
- `include/commands/delete.h`: Updated function signature for `CallDeleteOne` to include `forceInlineWrites`.
2024-08-16 18:24:51 +03:00
Parag Jain 42ed6a522f Merged PR 1429310: support for same source and target in $merge and some Internal error fixes.
### 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
Enable support for same source and target : Merge stage

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Enable support for using the same source and target in the merge stage of BSON aggregation.

#### PR Summary
This pull request introduces support for using the same collection as both the source and target in the merge stage of BSON aggregation pipelines.
- Modified `bson_aggregation_stage_merge_tests.sql` and `bson_aggregation_stage_merge_tests.out` to add tests for the new feature.
- Updated `bson_aggregation_output_pipeline.c` to remove the error check preventing the same source and target collections and added a TODO for future optimization.
2024-08-16 18:24:51 +03:00
Vinod Sridharan 2a1da01497 Merged PR 1427806: Fixes for create index background
### Does this PR have any customer impact?
Bugfixes for Background indexes

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

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

1) On index failure due to unique index violation, return DuplicateKey with the same error as insert
2) If an index build is in progress and a concurrent build is requested, wait on the concurrent build (rather than returning "build with the same options exist" - this means that if the first index build fails both calls fail and the second call doesn't assume the index exists
3) Don't query index builds during write commands (only query valid indexes for `$merge`, `$indexStats` etc
4) When an index build fails, don't immediately remove it from the index queue. Instead mark it as skippable. Once all the index builds complete after 20 mins, the index will be removed from the queue. This solves the issue of "index build failed but index was not found in main table"
5) Push unique index build to the background - running it in the foreground did not produce a better experience from private preview feedback
6) If the index build fails with a Mongo error, immediately mark it as skippable (not as failed)

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

#### PR Summary
This pull request addresses issues with creating indexes in the background by improving error handling and index conflict detection.
- `commands_common.c`: Added `TryGetErrorMessageAndCode` function to improve error message retrieval and handling.
- `create_indexes.c`: Enhanced conflict detection for index specifications and added handling for indexes in progress.
- `create_indexes_background.c`: Improved error handling and logging for background index creation.
- `index.c`: Updated SQL queries to include index build progress status.
- `cluster_operations.c`: Adjusted setup logic to handle index build tasks more effectively.
2024-08-16 18:24:51 +03:00
Jayanta Mondal 775122702e Merged PR 1427662: Fixing locale of the ubuntu Test container
### 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

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

### Description

Fixing locale of the ubuntu Test container, Mariner already sets this the way we want

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix to ensure consistent collation settings during PostgreSQL initialization.

#### PR Summary
This pull request updates the PostgreSQL initialization scripts to enforce consistent collation settings.
- Updated `oss/scripts/utils.sh` to include locale and encoding settings in `initdb` command.
- Modified `scripts/emulator_entrypoint.sh` to set locale and encoding during PostgreSQL initialization.
- Adjusted `scripts/pipeline_setup_jstests.sh` to apply locale and encoding settings in multiple `initdb` commands.
- Added collation settings to `scripts/utils.sh` for database initialization.
- Included schema listing commands in `helio_test_helpers.sql` and `pgmongo_test_helpers.sql` for better test visibility.
2024-08-16 18:24:51 +03:00
Santiago Fernandez Madero 836b6aaa9e Merged PR 1424086: Add a parse aggregation expression context while parsing the aggregation expressions
Flows a parse aggregation expression context while parsing the expression so that we can track if there were variables, operators, path expressions and do top level validation if needed for things like $let, etc.

----
#### AI description  (iteration 1)
#### PR Classification
API change to add a parse aggregation expression context while parsing aggregation expressions.

#### PR Summary
This pull request introduces a `ParseAggregationExpressionContext` to track the types of expressions encountered during the parsing of aggregation expressions.
- `include/operators/bson_expression_operators.h`: Added `ParseAggregationExpressionContext` parameter to various `ParseDollar*` functions.
- `src/operators/bson_expression_bitwise_operators.c`: Updated bitwise operator parsing functions to include the new context parameter.
- `src/operators/bson_expression_date_operators.c`: Modified date operator parsing functions to use the new context parameter.
- `src/operators/bson_expression_string_operators.c`: Updated string operator parsing functions to include the context parameter.
- `include/operators/bson_expression.h`: Defined the `ParseAggregationExpressionContext` struct.
2024-08-16 18:24:51 +03:00
Ayush Saluja 55d58335bc Merged PR 1423558: [pgmongo] Defensive check for epoch conversion to pg_timestamp
### Does this PR have any customer impact?

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

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

adding a defensive check before
Generally all the drivers or clients have the check to only allow valid ranges of datetime/timestamp as input.
But , on a specific case if cx tries to convert to date a number or long using $todate function and then tries to convert it to string from date object then we were giving internal error.

As of now , have added a defensive check to fail fast on error before calling pg function

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix to add a defensive check for epoch conversion to PostgreSQL timestamp.

#### PR Summary
This pull request introduces a defensive check to prevent errors during the conversion of Unix epoch milliseconds to PostgreSQL timestamps.
- `oss/pg_helio_core/include/utils/date_utils.h`: Added a range check to validate the seconds before conversion to `timestamptz`.
- `pgmongo/src/test/regress/sql/bson_aggregation_date_operators_tests.sql`: Added test cases to verify the defensive check.
- `pgmongo/src/test/regress/expected/bson_aggregation_date_operators_tests.out`: Updated expected output to reflect the new error messages for invalid conversions.
2024-08-16 18:24:51 +03:00
Parag Jain 76c09bbe76 Merged PR 1425970: Changing error code so error does not shown as internal error.
### 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

correcting error code

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix to change error codes so that errors are not shown as internal errors.

#### PR Summary
This pull request updates error codes to prevent certain errors from being classified as internal errors.
- `pcre_regex.c`: Changed error codes from `MongoInternalError` to `MongoOverflow` for PCRE2 context creation failures.
2024-08-16 18:24:51 +03:00
Vinod Sridharan 0101c6957b Merged PR 1425386: [Native AOT] Move the C# Gateway to AOT
### 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?
No

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

### Description
Use the AOT C# Gateway as default. Run the JSTests against an out-of-proc AOT gateway.
Delete some dead code and support tests setting JSTest config.

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

#### PR Summary
This pull request introduces a new AOT (Ahead-Of-Time) Gateway for the project, including configuration, logging, and pipeline setup.
- Added `SetupConfiguration.JsTests.json` for configuring the AOT Gateway.
- Updated `.pipelines/templates/managed_test.yml` to include steps for setting up and starting the managed gateway.
- Enhanced logging capabilities in `LoggingOptions.cs` and `PostgresMongoServiceHost.cs` to support file-based logging.
- Modified `pipeline_build_gateway_layout.sh` to always use the NativeAOT build path.
- Added `Serilog.Extensions.Logging.File` package in `Mongo.Host.Postgres.Linux.csproj` for file logging support.
2024-08-16 18:24:51 +03:00
Vinod Sridharan 2af2dff143 Merged PR 1425556: [Colocation] Enable Colocation by default
### 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?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Enable Colocation for existing clusters and turn it on by default.

Skip Colocating tables if they are part of an existing database that has non-colocation enabled tables. This will maintain back-compat for older clusters.

----
#### AI description  (iteration 1)
#### PR Classification
Enable colocation by default.

#### PR Summary
This pull request enables colocation by default and updates the related test cases to reflect this change.
- `native_colocation_tests.sql`: Updated SQL queries to use specific database names (`dbcolo` and `dbcolo2`) for colocation operations.
- `native_colocation_tests.out`: Adjusted expected output to match the new colocation settings and database names.
2024-08-16 18:24:51 +03:00
Parag Jain 90c74bcb94 Merged PR 1412316: [Feature] Merge Index Push down for join condition Part-3
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Adds support for index pushdown in join conditions for the `$merge` stage in aggregation pipelines.

#### PR Summary
This pull request introduces index pushdown capabilities for join conditions in the `$merge` stage, enhancing query performance.
- `src/opclass/index_support.c`: Added support functions for index pushdown in `$merge` join filters.
- `sql/udfs/aggregation/bson_merge_functions--1.20-0.sql`: Created new SQL functions to support index pushdown and handle merge operations.
- `src/aggregation/bson_aggregation_output_pipeline.c`: Implemented functions to create join expressions and extract merge filters.
- `Tests.Postgres.CSharp/Integration/Aggregation/MergeTests.cs`: Added integration tests to verify index pushdown functionality.
- `src/metadata/metadata_cache.c`: Added function OIDs for new merge-related functions.
2024-08-16 18:24:51 +03:00
Cornelius Boateng eb7a06ea93 Merged PR 1423135: [Aggregation Stages] setWindowFields $count
### 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
Added support for $count in $setWindowFields Stage

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Adds support for `$count` accumulator in `setWindowFields` aggregation stage.

#### PR Summary
This pull request introduces the `$count` accumulator to the `setWindowFields` aggregation stage, along with corresponding tests and implementation.
- `oss/pg_helio_api/src/aggregation/bson_aggregation_window_operators.c`: Added `HandleDollarCountWindowOperator` function to handle `$count` window aggregation operator.
- `pgmongo/src/test/regress/sql/bson_aggregation_pipeline_stage_setWindowFields.sql`: Added multiple test cases for `$count` accumulator with various window specifications.
- `gateway/managed/Tests.Integration.Shell.Postgres/60_postgres_10260.csv` and `70_postgres_10260.csv`: Updated test results to reflect the support for `$count` in `setWindowFields`.
2024-08-16 18:24:51 +03:00
Manish Gaur 2fff0dca08 Merged PR 1424268: Version update to start pgmongo 1.20 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?

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

### Description

Version update to start pgmongo 1.20 release

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

#### PR Summary
This pull request updates the version numbers and adds release notes for the pgmongo 1.20 release.
- Added release notes in `docs/release_notes/pgmongo_1.21.md`
- Updated version numbers in `pg_helio_api.control`, `pg_helio_core.control`, and `pgmongo.control`
- Added SQL migration scripts for version updates in `pg_helio_api`, `pg_helio_core`, and `pgmongo`
- Updated table of contents in `docs/release_notes/toc.yml`
- Updated SHA1 checksums for SQL scripts in `pgmongo/sql/sha1`
2024-08-16 18:24:51 +03:00
Deepak Bisht b08ac5b39e Merged PR 1402307: Support $avg and $push in $setWindowFields stage with inverse transition
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
- Add support for $avg, $push in $setWindowFields stage.
- Add inverse transition functions for $sum, $avg, $push

### Description
Add the inverse transition function for $sum, $avg and $push for optimal window aggregation.

Also for `$push` it is not currently usable in windowing because of its specific state requirement, need to add another state for window operation for `$push`
2024-08-16 18:24:51 +03:00
Xiaochun Liang 622d392bf2 Merged PR 1376029: stdDevPop and stdDevSamp accumulator for group by aggregation
### 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
Implementation of $stdDevPop and $stdDevSamp accumulators.

Reference:
[stdDevPop](https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/)
[stdDevSamp](https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/)

Related work items: #3277074
2024-08-16 18:24:51 +03:00
Vinod Sridharan 97ec6b9a9e Merged PR 1423159: Internal error fix and correct feature flag
### 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

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

### Description
- Implement READ for some scan types to avoid internal errors
- Move feature flag for local shard use to the local shard use feature flag.

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix and feature flag correction.

#### PR Summary
This pull request addresses an internal error and corrects the usage of a feature flag.
- `custom_scan_continuation.c`: Added functions for reading and writing custom scan nodes, replacing unsupported functions.
- `rum_custom_join_scan.c`: Added functions for reading and writing custom join scan nodes, replacing unsupported functions.
- `api_hook_impl.c`: Corrected feature flag usage from `EnableNativeColocation` to `UseLocalExecutionShardQueries`.
- `custom_query_scan.c`: Updated error messages for unsupported node types to be more specific.
2024-08-16 18:24:51 +03:00
Vinod Sridharan c9e638208a Merged PR 1420391: Multinode & Multi-region improvements
### 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

Multinode improvements: Better diagnostics on sharding:
- This shows each data bearing node as a "shard_##"
- It shows each sharded table and what nodes the shards are on.
- Shows the rebalancer as off and auto-split as off
![image.png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1420391/attachments/image.png)

Introduces the chunks table where we can report chunks and sizes:
![image (2).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1420391/attachments/image%20%282%29.png)

- This will also report sizes of each chunks so you can run aggregate queries to get size per node, size per table etc.
----
#### AI description  (iteration 1)
#### PR Classification
Enhancement for multinode and multi-region support.

#### PR Summary
This pull request introduces significant improvements to the multinode and multi-region capabilities of the system by adding new query rewriting functions and enhancing existing ones.
- `shard_colocation.c`: Added `RewriteConfigShardsQueryForDistribution` to handle shard configuration queries and `RewriteConfigChunksQueryForDistribution` to manage chunk configuration queries, including integration with Citus for shard size information.
2024-08-16 18:24:51 +03:00
Jayanta Mondal c364498a71 Merged PR 1413823: [engine] Additional tests and doc update for nested object index term truncation
### Does this PR have any customer impact?
No

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

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

### Description

1. Additional operator tests with truncated index terms
2. updated release notes
3. Updated index term truncation status docs
2024-08-16 18:24:51 +03:00
Vinod Sridharan 9250ed6931 Merged PR 1419383: [Flex] Fix rpath and copy of libs in Pgmongo extension
### Does this PR have any customer impact?
Fix rpath and copy of libs in Pgmongo extension

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

### 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
Fix rpath and copy of libs in Pgmongo extension

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix to correct rpath and library copying in the Pgmongo extension for Flex builds.

#### PR Summary
This pull request addresses issues with runtime linker search paths and library copying in the Pgmongo extension when building for Flex.
- `pgmongo/Makefile`: Adjusted rpath settings and included `makefile.flex` for Flex builds.
- `scripts/flex/setup_pgmongo_layout.sh`: Removed unnecessary startup script copying and adjusted control file directory paths.
- `scripts/install_setup_citus_core.sh` and `scripts/build_dev_flex_container.sh`: Added Flex build flags.
- `scripts/makefile.flex`: Added new makefile to override rpath for Flex.
- Deleted `scripts/flex/OnStartup/on-startup-001-setup-extension.sh` as it is no longer needed.
2024-08-16 18:24:51 +03:00
Parag Jain f18511e737 Merged PR 1415927: [Infra] Native Colocation for flex pipelines and Minor Fixes
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Infra
### 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
Let's enable native colocation for the all mariner runs in pipeline.

----
#### AI description  (iteration 1)
#### PR Classification
Infrastructure enhancement and minor bug fixes.

#### PR Summary
This pull request introduces native colocation for flex pipelines and includes minor bug fixes and enhancements.
- `PostgresMongoResultExtensions.cs`: Added handling for a new error message related to unsupported `EXPLAIN` with `MERGE` commands.
- `merge_stage_cx_scenario.js`: Added a test to verify that `EXPLAIN` is not supported with `MERGE` commands involving repartition.
- `pgmongo_postgres_flex.conf`: Enabled native colocation configuration.
- `utils.sh`: Updated Postgres configuration setup to include flex configuration for specific OS.
- `setup_test_env.yml`: Added `OsSku` parameter to the test environment setup.
2024-08-16 18:24:51 +03:00
Vinod Sridharan e3f19c609a Merged PR 1418794: [Native AOT Prep] Prepare for AOT related changes & Some backend perf
### 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

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

### Description

Gateway:
- Delete dead code from DisposableArraySegmentStream, VirtualByteArrayStream, CancellationTokenSourceExtensions, SoftTimeout, CosmosMongoResponse
- Reuse the same IList<IProtocolRequestMessage> across a connection
- Increase the DefaultIdleRefreshInterval per connection
- Trace dotnet counters into PgmongoGatewayDebug
- Dispose the request in the preauth path
- use SourceGenerated Explain ser/der and remove newtonsoft Json in that path

Backend:
- Don't copy the Cursor plan for single Page or non-cursor queries
- use Packed Pgbson for response bsons
- Don't evaluate index pushdowns on Btree/Vector indexes
- Remove allocation for table name in the planner path

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup and performance improvements in preparation for Native AOT changes.

#### PR Summary
This pull request removes unused classes and updates serialization attributes to improve backend performance and prepare for future AOT changes.
- Removed `MongoSoftTimeout` class from `Mongo.Core.Common/MongoSoftTimeout.cs`.
- Updated serialization attributes in `Mongo.Service.Postgres/Helpers/PostgresExplainHelper.cs` and added `PostgresExplainHelperContext` for JSON source generation.
- Removed `VirtualByteArrayStream` class from `Compute.Core/Utilities/VirtualByteArrayStream.cs`.
2024-08-16 18:24:51 +03:00
Cornelius Boateng d4bc5366ff Merged PR 1415920: [Operators] Support for Trigonometry operators
### Does this PR have any customer impact? Yes

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

### 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
Implemented support for $degreesToRadians, $radiansToDegrees, $sin, $cos, $tan, $sinh, $cosh, $tanh, $asin, $acos, $atan, $atan2, $asinh, and $atanh trig operators

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

#### PR Summary
This pull request adds support for trigonometric operators in BSON expressions.
- Added trigonometric functions (`$sin`, `$cos`, `$tan`, `$sinh`, `$cosh`, `$tanh`, `$asin`, `$acos`, `$atan`, `$atan2`, `$asinh`, `$acosh`, `$atanh`) in `oss/pg_helio_api/src/operators/bson_expression_trigonometry_operators.c`.
- Added extensive test cases for the new trigonometric operators in `/pgmongo/src/test/regress/expected/bson_aggregation_trigonometric_operators_tests.out`.
2024-08-16 18:24:51 +03:00
Murat Tuncer 3c3d57e6ab switch to PG16 2024-08-16 18:24:09 +03:00
gledis69 7e95cf5232 Redo the dependecy install 2024-08-16 18:24:09 +03:00
gledis69 caf2fe2899 Add libbson install back 2024-08-16 18:24:09 +03:00
gledis69 b3f6ba96ed Elevate all the install permissions 2024-08-16 18:24:09 +03:00
gledis69 0295952ce9 Give elevated premissions to pcre2 install 2024-08-16 18:24:09 +03:00
gledis69 c8d6c53993 Try without mongo-c-driver 2024-08-16 18:24:09 +03:00
gledis69 0551c58e7e Fix install step 2024-08-16 18:24:09 +03:00
gledis69 c848e1ddc2 Print intall_setup contents 2024-08-16 18:24:09 +03:00
gledis69 e9ef818084 Test installing without sudo 2024-08-16 18:24:09 +03:00
gledis69 a072014215 Switch up install order 2024-08-16 18:24:09 +03:00
gledis69 bf5fa8a4cb Split the script steps in order to find where the issue is 2024-08-16 18:24:09 +03:00
gledis69 06e0c08826 Add debug step 2024-08-16 18:24:09 +03:00
gledis69 c26840d9b0 Try making sudo non interactive for the scripts 2024-08-16 18:24:09 +03:00
gledis69 59bed7d6d9 Try specifying shell 2024-08-16 18:24:09 +03:00
gledis69 285ad323bf Fix workflow syntax 2024-08-16 18:24:09 +03:00
gledis69 d63eb10749 Run sql tests without caching container 2024-08-16 18:24:09 +03:00
Gledis Zeneli f425a7f946 Fix internal compatibility test (#38)
Make fixes and improvements to the internal compatibility test
2024-08-14 01:31:50 +03:00
Rajesh Kumar Thandapani 24704eb978 Merged PR 1409491: Change Stream implementation with Direct WAL decoding (without replication slots)
### Does this PR have any customer impact?
 Yes, it provides support for $changeStream pipeline stage for creating change stream cursor and consuming events from it.

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

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Adds a new UDF for change_stream_aggregation

### Are you introducing any new config? If yes, do you have tests with and without them being set?
Adds a GUC for enabling ChangeStreams freature and tests have been added to test the feature. It is disabled by default.

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
../docs/pgmongo/design_docs/data_plane/change_streams/change_stream_release_notes.md

### Description

This PR implements the change stream tailing cursors using the direct WAL decoding. It avoids using replications slots for logical decoding because of the constraints in creating and decoding with replication slots.

Related work items: #2973720
2024-07-31 17:09:22 +03:00
Vinod Sridharan 09b8db5c20 Merged PR 1417360: [Gateway] Add prepare for Find/Insert and some internal error fixes
### 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)
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
Support prepare for operations that have fixed args with feature flag off

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

#### PR Summary
This pull request introduces a new configuration option to skip the preparation of requests in the Postgres Mongo service.
- Added `SkipPrepare` property in `PostgresTenantConfiguration.cs` to read the new configuration.
- Updated `PostgresMongoRequestHandler.cs` to pass the `skipPrepare` flag to `PostgresRequestOptions`.
- Modified `PostgresRequestOptions.cs` to include the `SkipPrepare` flag.
- Added `pgmongo.skipPrepare` configuration in `pgmongo.c`.
- Updated `PostgresClient.cs` to conditionally call `PrepareAsync` based on the `SkipPrepare` flag.
2024-07-31 17:09:22 +03:00
Jia Hu 👻 1349f83b04 Merged PR 1409558: support DBRef in match
### 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 DBRef in match

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

#### PR Summary
This pull request adds support for handling DBRef objects in query matching.
- `src/query/query_operator.c`: Added `CreateQualsForDBRef` function to handle DBRef fields (`$ref`, `$id`, `$db`) in queries.
- Modified `CreateQualsFromQueryDocIteratorInternal` to integrate the new DBRef handling logic.
2024-07-31 17:09:22 +03:00
Vinod Sridharan 48020446af Merged PR 1415642: [Perf] Enable Cross Rum Index joins
### 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)
No

### Are you introducing any new config? If yes, do you have tests with and without them being set?
Yes (Feature flag for scan perf)

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

### Description
Enables joining across multiple RUM indexes for bitmap scans (so that the user doesn't need to create a single composite index for performance).

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

#### PR Summary
This pull request introduces optimized cross RUM index joins to enhance query performance.
- Added `rum_custom_join_scan.c` to implement custom scan logic for RUM index joins.
- Updated `rumget.c` to include `multiandgetbitmap` function for handling multiple index scans.
- Modified `custom_scan_continuation.c` to integrate custom scan paths and optimize query plans.
2024-07-31 17:09:22 +03:00