Commit Graph
42 Commits
Author SHA1 Message Date
Santiago Fernandez Madero e67907c67d Merged PR 1271505: Bump main to 1.14
Bump main to 1.14
2024-02-14 11:28:20 +03:00
Lucas Borges Fernandes 0a88ba774d Merged PR 1269659: [OSS] Changing helio major version to 1 for compatibility
### Description

Bumping major version to 1 in order to prevent future errors with version check utility functions.
2024-02-14 11:28:20 +03:00
Santiago Fernandez Madero ca7fe5ea32 Merged PR 1265227: Add container build and test github action to heliodb
Tested on my own fork: https://github.com/safern/heliodb/actions
2024-02-07 23:20:07 +03:00
Vinod Sridharan 6c8bf4f145 Merged PR 1268933: Enable Primary key lookup pushdown
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Performance
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
Push primary key lookup where available
### Description
Due to RUM index limitations today we would push to the rum index even if we are matching a single doc or a few docs. Ensure that we have a primary key lookup if we see an explicit lookup there

Primary key lookup
2024-02-07 23:20:07 +03:00
Tanvi Bhandari b9d48d0f37 Merged PR 1267753: Fix for stale index entry in PG
### 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

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

### Description

**Issue**
During testing in westus3 (TIP), we have observed that sometimes for long running create index, if user tries to cancel it by running `dropIndexes` concurrently, then sometimes `DROP INDEX CONCURRENTLY` causes BE server failure then this results in following things:
1. Index request is removed in `pgmongo_index_request` table
2. Index is not really dropped from the system and marked INVALID by Postgres.
3. The index metadata in `collection_indexes` also exists (invalid state).
4. In short, this leaves the system with stale index metadata + invalid index entry.
5. Since `index_build_is_in_progress` considers Skippable index, the `getIndexes()` and `CheckIndexSpecConflictWithExistingIndexes` will return the index entry

**Symptom**
1. `getIndexes` API will return index entry.
2. User will not be able to recreate the index with same definition because of `CheckIndexSpecConflictWithExistingIndexes`
3. The index is marked INVALID as per `postgres`.
4. Queries will not be able to use the index which is fine because user anyways wanted to cancel the index creation in first place.
5. Index metadata also contains the index entry (is_valid = false)

**Mitigation**
1. User can explicitly call DropIndex(<index-name>) API to fix the state of system.

**Solution**
1. Delete CreateIndex request from queue via `CleanupIndexBuildRequest` once everything is done in `dropIndexes`.
2. Make sure that we do not return indexes which are marked Skippable in `index_build_is_in_progress`

This will result in following things:
1. `getIndexes` API will not return the skippable entry
2. User will be able to recreate the index with same definition
3. The Cron-job will delete everything about this Skippable index request from system after 20 mins (aka IndexQueueEvictionIntervalInSec)
2024-02-07 23:20:07 +03:00
Mehmet Yilmaz cb797d3eae Merged PR 1261782: [OSS] Move drop_database function to OSS
### 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)
UDF

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

### Description
Move drop_database function to OSS
2024-02-07 23:20:07 +03:00
Zinan Ren 🐾 69118d324f Merged PR 1246367: [Vector Search] Support pre-filtering in search - Part 2
### Known limitations & TODO for part 2
- [ ]  The current implementation intersects results from both vector index and bitmap index, it is actually the post-filtering
- [ ]  Not work for sharded collection

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

### New explain result
![image (5).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1246367/attachments/image%20%285%29.png)
From mongo command:
```
SELECT document FROM
    bson_aggregation_pipeline('db', '
        {
        "aggregate": "aggregation_pipeline_ivf_filter",
        "pipeline": [
                {
                "$search": {"cosmosSearch": { "vector": [ 3.0, 4.9, 1.0 ], "k": 4, "path": "v", "filter": { "a": "some sentence" }, "nProbes": 1 }  }
                }
        ],
        "cursor": {}
}');

```
To psql command
```
1. SELECT c1(search query):
			SELECT
				document,
				(public.vector(mongo_catalog.bson_extract_vector(collection.document, 'v'::text), 3, true) OPERATOR(public.<=>) public.vector(mongo_catalog.bson_extract_vector('{ "vector" : [ { "$numberDouble" : "3.0" }, { "$numberDouble" : "4.9000000000000003553" }, { "$numberDouble" : "1.0" } ], "k" : { "$numberInt" : "1" }, "path" : "v" }'::mongo_catalog.bson, 'vector'::text), 3, true)) AS orderVal,
				ctid
			FROM
				mongo_data.documents_1 collection
			WHERE
				shard_key_value = 0
				AND ((mongo_catalog.bson_extract_vector(collection.document, 'v'::text) IS NOT NULL))
			ORDER BY
				(public.vector(mongo_catalog.bson_extract_vector(collection.document, 'v'::text), 3, true) OPERATOR(public.<=>) public.vector(mongo_catalog.bson_extract_vector('{ "vector" : [ { "$numberDouble" : "3.0" }, { "$numberDouble" : "4.9000000000000003553" }, { "$numberDouble" : "1.0" } ], "k" : { "$numberInt" : "1" }, "path" : "v" }'::mongo_catalog.bson, 'vector'::text), 3, true))
2. SELECT c2(filter query):
			SELECT
				ctid
			FROM
				mongo_data.documents_1
			WHERE
				shard_key_value = 0
				AND document @@ '{ "a": "some sentence" }'

3. JOIN c1 ON c1.ctid = c2.ctid
			SELECT
				c1.document
			FROM c1 JOIN c2 ON c2.ctid = c1.ctid
			ORDER BY c1.orderVal
			LIMIT 1
```

Related work items: #2586299
2024-02-07 23:20:07 +03:00
Mehmet Yilmaz 48e0ca3d05 Merged PR 1255683: Refactor geospatial func name in oss
Refactor geospatial func name in oss
2024-02-07 23:20:07 +03:00
Vinod Sridharan da2c098f3c Merged PR 1265302: Make sh.status() work
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
Make sh.status() work in mongo shell.

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

With these changes, this now looks like:
![image (2).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1265302/attachments/image%20%282%29.png)
2024-02-07 23:20:07 +03:00
Lucas Borges Fernandes a4f49d76af Merged PR 1263501: Querying PG authenticated user for LibPQ connections
### Description

A bug was found while trying to create indexes on top of Meru. We internally create a new Postgres connection using the LibPQ API without providing the username, causing permission issues. This PR fixes this.
2024-02-07 23:20:07 +03:00
Tanvi Bhandari e5be945fef Merged PR 1265017: Merged PR 1264390: To enable feature in 1.12 and main release as well
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
NA
### Description

1.  !1264390 PR merged
2. Delete the old queue table in upgrade path from all nodes
3. Add the upgrade scenario 1.12 -> latest in BE test
2024-02-07 23:20:07 +03:00
Tanvi Bhandari 08365f523c Merged PR 1262739: To enable feature in 1.12 and main release as well
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
To enable IndexBuild Background in 1.12

### Description
To enable IndexBuild Background in 1.12 on old schema and new schema as well based on cluster version.
2024-02-07 23:20:07 +03:00
Vinod Sridharan 3775e5a27a Merged PR 1263670: Add more checks for OSS references
### 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)

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

### Description

Add more checks for OSS references
2024-02-07 23:20:07 +03:00
Santiago Fernandez Madero b063424b6d Merged PR 1263734: Fix segfault in insert by setting the right param list size
Fix segfault in insert by setting the right param list size.

Since we're allocating more space to be on the safe size and overrun memory, we need to set the paramList size to the actual batch size to avoid getting garbage memory and been prone to seg fault.
2024-02-07 23:20:07 +03:00
Vinod Sridharan b411fc3944 Merged PR 1262518: Remove extra feature flag for Index truncation
### 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

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

### Description
Index truncation had 2 levels of flags (one a GUC, and another is an index option).
Leave behind the index option and remove the GUC (Customers can opt-in using this undocumented flag).
2024-02-07 23:20:07 +03:00
Vinod Sridharan 6c22592a58 Merged PR 1261022: Fix up memory leaks on compare
### Does this PR have any customer impact?
No? Or makes it better

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

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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
Fix up memory leaks in sort, group, create index

### Description
Fix up memory leaks on compare: for TOAST tuples, or compressed tuples, we would decompress or load tuples in memory. These weren't freed in the case where we were in the tuple sort contexts.
2024-02-07 23:20:07 +03:00
Manish Gaur ac6ae0a7c6 Merged PR 1259477: Updating version for 1.12 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)

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

### Description

Updating version for 1.12 release
2024-02-07 23:20:07 +03:00
Mehmet Yilmaz 73cf79a3ca Merged PR 1258267: Refactor bson aggregation pipeline test in OSS
### 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

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

### Description
Refactoring schema name in the bson aggregation pipeline test in OSS
2024-01-31 12:06:30 +03:00
Tanvi Bhandari b1d31514b2 Merged PR 1244012: Misc changes 'mongo_catalog.pgmongo_index_queue'
1. Make index queue table name compatible to oss i.e its name should be helio_api_catalog.helio_index_queue and grant permission for helio_admin_role

2. Add citus_add_local_table_to_metadata('helio_api_catalog.helio_index_queue')

3. Due to extension upgrade scripts, the table was created on all nodes of cluster. Therefore, dropped the table from all nodes.
And create it only on coordinator using initialize_cluster(for new cluster) and complete_pgmongo_upgrade (for upgrade path)

4. Simplify CleanUpIndexBuildRequest query

Related work items: #2897026
2024-01-31 12:06:30 +03:00
Mehmet Yilmaz e2f438d8ba Merged PR 1244566: Refactor allow_nested_distributed_execution conf in oss
Refactor allow_nested_distributed_execution conf in oss
2024-01-31 12:06:30 +03:00
Vinod Sridharan 45608162fd Merged PR 1256608: [Truncation] Disable Truncation on all wildcard indexes, text and hash indexes
Disable Truncation on all wildcard indexes, text and hash indexes
2024-01-31 12:06:30 +03:00
Mehmet Yilmaz dc0f79ce70 Merged PR 1234831: [OSS] Move drop indexes procedure to OSS
Move drop indexes procedure to oss
2024-01-31 12:06:30 +03:00
Vinod Sridharan 1ca13d07e5 Merged PR 1253069: [Truncation] Fix up a bug with single path wildcard index with truncation
Fix up a bug with single path wildcard index with truncation
2024-01-31 12:06:30 +03:00
Vinod Sridharan 03c69f703d Merged PR 1249283: [Index Truncation] Add more tests and allow per index registration of truncation
1) Enable per index enablement of truncation
2) Add more tests for aarray truncation
3) Reduce prefix paths for single path indexes
2024-01-19 14:59:12 +03:00
Vinod Sridharan 628c576d6f Merged PR 1250361: Modify more references for OSS
Remove more references  in code that match the contract with the OSS extension.
2024-01-17 22:08:45 +03:00
Santiago Fernandez Madero d6b2c3aab4 Merged PR 1248408: [OSS] Fix listIndexes and listCollections command
List indexes was broken in OSS:
- when generating the backend query we were using the api.list_indexes SQL UDF which is the former/old way before cursors support to list indexes and it is available in pgmongo, but since that is obsolete and don't support cursors, we didn't added it to OSS.

Fix is to instead generate a query that fetches directly from the `helio_api_catalog.collection_indexes` table which is basically what list_indexes did:

```
SELECT mongo_api_internal.index_spec_as_bson(index_spec, TRUE)
        FROM mongo_catalog.collection_indexes
        WHERE collection_id = v_collection.collection_id AND
              (index_is_valid OR mongo_api_internal.index_build_is_in_progress(index_id))
        ORDER BY index_id
```
List Collections was broken in OSS because we were using the wrong schema to get the `row_get_bson` UDF and the OpExpr for the text equality for the query where clause `database = <dbName>` , we were not specifying a collation and postgres was failing with:

```
ERROR:  could not determine which collation to use for string comparison
HINT:  Use the COLLATE clause to set the collation explicitly.
```
2024-01-17 22:08:45 +03:00
Lucas Borges Fernandes 9839f0610e Merged PR 1249793: Changing extension name to helio in all OSS files
Removing references from the old extension name.
2024-01-17 22:08:45 +03:00
Tanvi Bhandari e56a5f6edb Merged PR 1216978: Add Index details in CurrentOp for CREATE INDEX
This PR is on top of !1215017 , I will keep both changes in separate PRs.

Does following for non-unique indexes CREATE INDEX .
1. Add DB name, collection name in currentOp
2. Add Index details in CurrentOp

NOTE: For Unique index (ALTER TABLE), current op does have collection name populated. We are not adding index details for unique index as of now. Tracking item #2843068

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

Related work items: #2826862, #2835383
2024-01-17 22:08:45 +03:00
Deepak Bisht cd6050eb08 Merged PR 1245028: [pgmongo][Geospatial] - enable Geospatial for Tests
enable Geospatial for Tests

Related work items: #2889615
2024-01-17 22:08:45 +03:00
Gledis Zeneli ffa180741a Merged PR 1205625: Migrate drop_collection to C 2024-01-17 22:08:45 +03:00
Vinod SridharanandVinod Sridharan 4c6b6d1fde [Infra] Add devcontainer for build time setup to HelioDB (#4)
* Add devContainer for build time setup to HelioDB
This allows for the development flow to simply be:

Developers open the repository in VsCode
Reopen in DevContainer
make/make install
make check
To run an adhoc server, developers can run in the dev-container

./scripts/start_helio_server.sh
---------

Co-authored-by: Vinod Sridharan <visridha@microsoft.com>
2024-01-15 10:18:24 -08:00
Vinod Sridharan 4aea8125e4 Merge pull request #3 from microsoft/visridha/intial_helio_commit
Initial commit for HelioDB
2024-01-15 09:59:56 -08:00
Vinod Sridharan d8671eb379 Initial commit for HelioDB 2024-01-12 19:10:20 +00:00
Murat Tuncer 9876da1a14 Merge pull request #1 from microsoft/users/GitHubPolicyService/6beb23d4-53ad-46b8-bce4-dd7d94d42d34
Adding Microsoft SECURITY.MD
2023-12-29 11:01:10 +03:00
Microsoft Open Source 54147c75a4 SECURITY.md committed 2023-12-27 09:20:11 -08:00
Microsoft Open Source fd4f59322c README.md updated to template 2023-12-27 09:20:11 -08:00
Microsoft Open Source cded62f618 SUPPORT.md committed 2023-12-27 09:20:10 -08:00
Microsoft Open Source 0962f9119c LICENSE updated to template 2023-12-27 09:20:09 -08:00
Microsoft Open Source cfc3e2086b CODE_OF_CONDUCT.md committed 2023-12-27 09:20:09 -08:00
microsoft-github-policy-service[bot] 89d98ead6d Microsoft mandatory file 2023-12-27 17:00:40 +00:00
microsoft-github-operations[bot] cc150f8608 README.md: Setup instructions 2023-12-27 17:00:30 +00:00
Abinav Rameesh c4234ea994 Initial commit 2023-12-27 09:00:17 -08:00