mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-08 11:55:30 -05:00
### 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`.