Commit Graph
17 Commits
Author SHA1 Message Date
Andrew Khoma e357bea5ac Merged PR 1696314: [Gateway][Rust] abstract all connection polling and data requests to pg behind trait
### Does this PR have any customer impact?
no
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
refactoring
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
no
### Are you introducing any new config? If yes, do you have tests with and without them being set?
no
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description

Define common interface for all user-related pg queries to be executed as part of the PgDataClient trait

Related work items: #3666511
2025-06-13 15:13:47 +08:00
Juan Carlos Aguilera Mendez e640ba76a7 Merged PR 1689393: Introduce a mechanism to swith between C# and Rust gateways at runtime
### Does this PR have any customer impact?

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

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

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

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

### Description

This change allows us to swap between C# and Rust gateways by setting the pgmongo.use_rust_native_gateway GUC on and off without depending on Flex "outside" restarts and trigger the restart at runtime.

We read the value of the GUC and if it doesn't match the running gateway, we gracefully shut it down. Upon restart by Docker, C# flow will be executed and StartupHost.sh will be executed. Since the GUC, pgmongo.use_rust_native_gateway, will also be set in a config file, and that will mandate the gateway to actually start up.

This change was validated against a dev cluster by setting the GUC on and off

----
#### AI description  (iteration 1)
#### PR Classification
This pull request introduces a new mechanism for runtime gateway switching, enabling a graceful shutdown of the C# gateway to transition to a Rust gateway.

#### PR Summary
The changes implement a unified shutdown mechanism that allows the service to detect a configuration flag for using the Rust native gateway and to trigger a graceful shutdown accordingly.
- **`Compute.Host/HostShutdown.cs`**: Added a new static class that provides a shutdown task and trigger method.
- **`Compute.Host/HostServiceContainer.cs`**: Introduced a configuration check for the "use_rust_native_gateway" flag that triggers shutdown via the new mechanism.
- **`Host.Postgres.Linux/PostgresMongoServiceHost.cs`**: Updated shutdown and signal handling to use the new HostShutdown mechanism, replacing the previous ctrl-break task approach.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-06-13 15:13:47 +08:00
Vinod Sridharan c6bc2bcb73 Merged PR 1694458: [POC|Order by] Order by Index & Pushdown improvements
### Does this PR have any customer impact?
Yes

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

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

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

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

### Description
More general improvements to order by and composite:
Create Indexes
1) Support creating a composite index side by side with a regular index
2) Block creation of descending or wildcard and unsupported set ups for composite indexes

Planner:
1) Support ordering by the Nth path of an index if the prefixes are equality.
2) Validate that if it's not the first column, prefixes are provided
3) Support incremental sort with index pushdown.

----
#### AI description  (iteration 1)
#### PR Classification
This pull request delivers a new feature and API enhancement to enable order-by index pushdown and refined composite index support.

#### PR Summary
The update streamlines composite index processing by introducing stricter equivalency checks, new UDF functions for full-scan order-by pushdown, and enhanced validations during index creation while updating explain outputs and tests.
- `src/metadata/index.c` refines index options equivalency logic to correctly compare composite term settings.
- `src/opclass/bson_gin_composite_entrypoint.c` and `src/index_am/rum.c` add functions to support order-by pushdown and manage duplicate entries efficiently.
- `sql/udfs/query/bson_dollar_comparison--0.105-0.sql` (and related operator files) introduce new UDFs including `bson_dollar_fullscan` to enable full scan operations.
- `src/commands/create_indexes.c` enforces new composite index validations (restricting use to ascending, non-wildcard regular indexes) with precise error reporting.
- Test scripts and explain plan outputs in the `regress` and `pgmongo` directories are updated to confirm the new composite order-by behavior.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-06-13 15:13:47 +08:00
Alexander Laye 3f8294a36a Merged PR 1689621: Change default for localhost to false
### Does this PR have any customer impact?

No

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

Bugfix

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

No

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

No

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

### Description

Change default for localhost to false

----
#### AI description  (iteration 1)
#### PR Classification
This pull request is a configuration change that updates the default behavior for local host usage.

#### PR Summary
The changes modify the configuration setup to return false by default for using localhost, ensuring that the application does not use the local host unless explicitly configured.
- `oss/pg_documentdb_gw/src/configuration/setup.rs`: Changed the `use_local_host` method to use `unwrap_or(false)` instead of `unwrap_or(true)`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-06-05 10:31:32 +08:00
Juan Carlos Aguilera Mendez c71b269fb8 Merged PR 1692164: Upgrading toolchain to remove warnings in PR gates
### Does this PR have any customer impact?

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

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

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

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

### Description

Upgrading toolchain to remove warnings in PR gates. "Installing an old toolchain, please consider upgrading. Latest available toolchain for v1 is 1.87."

Tested locally in dev container to make sure the gateway started and there were no cargo dependency issues

----
#### AI description  (iteration 1)
#### PR Classification
Toolchain upgrade to address warnings in PR gates.

#### PR Summary
This pull request updates the Rust toolchain version used in both the development container and pipeline configuration to maintain consistency and eliminate warning messages.
- `/.devcontainer/Dockerfile`: Updated the MSRUSTUP_TOOLCHAIN from ms-1.84.1 to ms-1.87.0.
- `/.pipelines/templates/common_variables.yml`: Set RustToolchainVersion to ms-1.87.0.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-06-05 10:31:32 +08:00
Vinod Sridharan 0ddb09436c Merged PR 1690832: [Composite] Remove array term generation for composite indexes
### Does this PR have any customer impact?
Not yet

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

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

### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description

This adds more changes for orderby support in the index
1) Fixes the correctness issue arising from indexing arrays for order by - we remove the top level array term from indexing. To handle this, we move the query operators to support querying the index correctly when the query is on an array
2) For `$elemMatch` this temporarily makes elemMatch just a full scan for now (a subsequent change wil tackle updating the logic)
3) Adds orderby to the top level schema for the internal extension
4) For exists false/true, we were pushing a lot more terms to the runtime recheck. Ensure that we're hitting the right index terms and evaluate correctly against the index.

----
#### AI description  (iteration 1)
#### PR Classification
This pull request is a code cleanup and enhancement that removes array term generation for composite indexes and updates related index term handling.

#### PR Summary
The changes streamline composite index generation by eliminating dedicated array terms, and they adjust boundary, metadata, and recheck logic to ensure consistent behavior. Key updates include:
- **`oss/pg_documentdb/src/opclass/bson_gin_composite_core.c`**: Removed redundant array term generation and introduced functions like `SetArrayEqualityBound` to properly handle equality bounds for arrays.
- **`oss/pg_documentdb/src/opclass/gin_index_term.c`**: Updated index term serialization and metadata management (including handling of undefined values via `GenerateValueUndefinedTerm`) to align with the new composite index behavior.
- **Test and expected output files**: Revised expected composite index term outputs and SQL tests to reflect the removal of array-specific terms.
- **Documentation and configuration**: Updated design docs and removed the configuration flag for skipping array term generation, consolidating the new composite index strategy.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-06-05 10:31:32 +08:00
Alexander Laye 90b141027e Merged PR 1684027: Add mongo 8 support to gateway
### Does this PR have any customer impact?

Nothing negative

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

Feature

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

No

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

No

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

Support Mongo version 8 in pg_documentdb_gw *[Feature]*

### Description

Add mongo 8 to list on version.rs

----
#### AI description  (iteration 1)
#### PR Classification
This pull request is an enhancement, adding native support for Mongo 8.

#### PR Summary
The changes update versioning in the OSS gateway to support Mongo 8 by extending the existing enum and its associated conversion methods.
- `oss/pg_documentdb_gw/src/configuration/version.rs`: Added the `Eight` variant to the enum and updated methods to parse "8.0", return `"8.0.0"`, provide the version tuple `[8, 0, 0, 0]`, and assign the corresponding numerical value.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4094504
2025-06-05 10:31:32 +08:00
William Wang f73f559f5d Merged PR 1680296: Adding Support for Verbose Trace in the Rust Gateway
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Livesite
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
Complete compute request tracker implementation in the rust gateway to meet parity with the c# gateway,
which will measure and record durations of major components involved in servicing Mongo tcp and http requests.
The duration interval kinds we collect can be found in the request_tracker.rs.

In this PR, we temporarily wrap ComputeRequestTracker inside RequestInfo. There is a subsequent code refactoring PR that introduces RequestContext which will be the permanent location referencing the tracker and will be passed down to all lower functions.

Related work items: #4139219
2025-05-29 12:12:31 +08:00
Alexander Laye 7d9280333a Merged PR 1681220: Restore the partity between c# and rust setup configuration
### Does this PR have any customer impact?

No

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

Bugfix

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

No

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

No

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

### Description

restore the partity between c# and rust setup configuration

----
#### AI description  (iteration 1)
#### PR Classification
This pull request implements a configuration design change to align Rust's setup configuration with its C# counterpart.

#### PR Summary
The PR updates multiple configuration JSON files and associated Rust code to flatten and standardize the configuration structure. Key changes include:
- **`SetupConfiguration.Cloud.json`**: Removed the nested `DocumentdbConfiguration` object and promoted its keys to the top level.
- **`SetupConfiguration.JsTests.json` & `SetupConfiguration.JsTests.ADO.json`**: Flattened the JSON structure by eliminating the nested configuration key.
- **`src/main.rs`**: Moved the configuration logging and added a clone for the setup configuration when passing it to `get_service_context`.
- **`src/configuration/setup_configuration.rs`**: Applied the `#[serde(flatten)]` attribute to the `documentdb_configuration` field for proper deserialization.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-29 12:12:31 +08:00
Ritvik Jayaswal 983a7390f7 Merged PR 1657382: Fixed create_indexes tests to use correct documentdb function
### Does this PR have any customer impact?

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

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

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

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

### Description

Previously, our integration tests were using create_index, but documentdb only supports create_indexes (plural)

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix for a failing test.

#### PR Summary
This pull request fixes the `create_indexes` and `drop_indexes` tests to correctly use the `create_indexes` function for compatibility with a DocumentDB backend.
- `integration_tests.rs`: Updated `create_indexes` and `drop_indexes` tests to use `create_indexes` with a list of `IndexModel` objects, ensuring proper function calls and assertions.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #4014913
2025-05-29 12:12:31 +08:00
Zinan Ren f4896e9c81 Merged PR 1670376: [ReleaseValidation] Add release validation tests for hnsw/diskann/filtering/compression
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Testing
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
1. Check the max dimensions when creating the vector index, previously checked by pgvector
2. Add the following release validation tests:
- HNSW index (M40 and above)
- DiskANN index (M30 and above)
- Filtering search (GA)
- Exact search (GA)
- Compression half (GA)
- Compression PQ (GA)

----
#### AI description  (iteration 1)
#### PR Classification
This pull request implements new vector search release validation tests and updates the backend’s vector index dimension checks and error messaging.

#### PR Summary
The changes add comprehensive release validation tests for vector search covering various compression types (PQ, half), index kinds (ivf, hnsw, diskann), filtering, and exact match scenarios.
- `outerLoop/releaseValidation/testSpecs/` now includes multiple new JSON spec files (e.g. ValidateVectorSearchCompressionPQ.json, ValidateVectorSearchCompressionHalf.json, ValidateVectorSearchDiskANN.json, ValidateVectorSearchHNSW.json, ValidateVectorSearchFiltering.json, and ValidateVectorSearchExact.json) with updated expected errors.
- Test scripts in `ReleaseValidation.Tests.NodeJs/test/test_signoffTestsNodeJS.js` and C# signoff test file `SignoffTestsCSharp.cs` have been modified to enable and incorporate these new vector search tests.
- In `pg_documentdb/src/commands/create_indexes.c`, additional checks enforce maximum dimensions based on compression type (non-compressed: 2000, half: 4000, PQ: as defined) and update error messages accordingly.
- Several Postgres gateway and pgmongo files have been updated to remove obsolete regexes and return revised error codes (e.g. error code 67) and messages for exceeding vector dimension limits.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-29 12:12:31 +08:00
Andrew Khoma b1d5b3bbab Merged PR 1675095: [Gateway][Rust] Eliminate client terminology for postgres connection and connection pools
### Does this PR have any customer impact?
no
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
refactoring
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
no
### Are you introducing any new config? If yes, do you have tests with and without them being set?
no
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
Refactor Rust gw to eliminate client terminology when it comes down to postgres connections

1. There were too many "clients" that in fact were nothing else than a postgres connection, either done by us (renamed to Connection type) or a raw connection from deadpool crate, so to make my further changes more readable I'm doing this refactoring as a required step
2. I've introduced a separate connection pool for auth requests as we had it combined before, so in case one connection pool is throttled the other conn pool works
3. Update dev utils such as rust analyzer to index over the oss project and update the git hooks
4. update ADO pipeline to include clippy and cargo fmt for OSS

----
#### AI description  (iteration 1)
#### PR Classification
This pull request is a refactoring update that replaces “client” terminology with “connection” to implement global postgres connection pooling in the Rust gateway.

#### PR Summary
The changes update naming and method calls to provide feature parity with a global postgres connection pool, standardizing connection handling across the codebase.
- In files under `/oss/pg_documentdb_gw/src/processor/`, functions now use `Connection` and `pull_connection` instead of `Client` and `pg`, updating transactional and cursor operations accordingly.
- In `/oss/pg_documentdb_gw/src/postgres/client.rs` and related modules, `Client` is renamed to `Connection` and `Pool` to `ConnectionPool` with adjusted internal method calls.
- In `/oss/pg_documentdb_gw/src/context/`, connection acquisition functions and error messages are updated to reflect the new connection terminology.
- In `/gateway/native/src/main.rs` and `/gateway/native/tests/common/mod.rs`, the global connection pool instantiation is revised, and the file `dataapi.rs` is moved and renamed to `data_api.rs`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #3666511
2025-05-29 12:12:31 +08:00
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
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
Shuai Tian 53e933bdb6 Merged PR 1648717: [oss] add copyright headers for pg_documentdb_gw
### 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

[oss] add copyright headers for pg_documentdb_gw

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

#### PR Summary
This pull request adds copyright headers to multiple source files in the `pg_documentdb_gw` project to ensure proper attribution and legal compliance.
- Added copyright headers to all source files in the `pg_documentdb_gw` directory, including `src/auth.rs`, `src/bson.rs`, and `src/configuration` modules.
- Updated files in the `src/context`, `src/explain`, `src/postgres`, `src/processor`, `src/protocol`, `src/requests`, and `src/responses` directories with copyright headers.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-23 12:04:26 +08:00
Zinan Ren 591a38b86d Merged PR 1606660: [Vector Search] Support half-precision vector indexing
### 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
With the release of pgvector 0.7.0, which supports [Half-Precision Indexing](https://github.com/pgvector/pgvector?tab=readme-ov-file#half-precision-indexing), vectors can have up to 4,000 dimensions

###Related GUCs
**documentdb.enableVectorCompressionHalf**: enable vector compression(enabled by default)
- off, disable vector compression
- on, enable vector compression

###New parameters
- Create index spec: "compression": string
"half": half-precision vector, which using 16 bits float

- Search spec: "oversampling": double
Oversampling factor: Oversampling retrieval from half index to compensate for the loss of precision.
Minimum value is 1. This parameter is only permitted when a compression method is used on the vector index.
 For example, if oversampling=1.5 and k=10, then oversampling*k=15 vectors from a compressed index. Then, the full 32-bits vector will be used for the subsequent ordering and scoring,

###Mongo Command
```
db.runCommand(
{ "createIndexes": "testing_vector_collection", "indexes":
[{
     "key": { "v": "cosmosSearch" },
     "name": "hsnw_index",
     "cosmosSearchOptions":
     {
         "kind": "vector-hnsw",
         "similarity": "L2",
         "dimensions": 3,
         "compression": "half"
     }
}]
} )
```
```
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,
        "oversampling": 2.0
      },
    }
  },
  {
    "$project": {
      "rank": {
        "$floor": [{"$multiply": [{ "$meta": "searchScore"},100000]}]
      }
    }
  }
])
```

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

#### PR Summary
This pull request adds support for half-precision vector indexing in the vector search functionality.
- `metadata_cache.c`: Added functions for half-precision vector similarity operators and functions.
- `SearchTests.cs`: Added integration tests to validate half-precision vector search, including error cases and index creation scenarios.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-23 12:04:26 +08:00
Alexander Laye 3fdfbb184b Merged PR 1627376: Add pg_documentdb_gw folder with Rust gateway for documentdb
### 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

This pr adds a Rust gateway for documentdb in the pg_documentdb_gw folder
2025-04-23 12:04:26 +08:00