mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### 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? Yes ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description Fix up add node to work - after add node create table fails - fix this up - This is because the reference tables for collections aren't replicated to the new node so we can't replicate the table + create shards on that node in the same command. Check on create table if all shards have reference tables - if not call replicate_reference_tables on create. ---- #### AI description (iteration 1) #### PR Classification Bug fix #### PR Summary This pull request addresses an issue with node addition in a distributed system by ensuring metadata tables are properly replicated. - `distributed_hooks.c`: Added `EnsureMetadataTableReplicatedCore` function to ensure metadata tables are replicated across nodes. - `helio_distributed_init.c` (new file): Introduced initialization for distributed configurations, including a new GUC `EnableMetadataReferenceTableSync`. - `pgmongo.c`: Moved read concern level definitions and configurations from `pg_helio_api` to `pgmongo`. - `api_hooks.c`: Added `EnsureMetadataTableReplicated` function to check and replicate metadata tables. - `create_collection_core.c` and `sharding.c`: Integrated `EnsureMetadataTableReplicated` to ensure metadata tables are handled during collection creation and sharding.