Files
documentdb/pg_helio_api/include/metadata
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
..
2024-01-12 19:10:20 +00:00
2024-01-12 19:10:20 +00:00