Skip to content

docs: GUC and feature flag configuration reference#2

Draft
richardsimmonds wants to merge 1 commit into
mainfrom
docs/guc-feature-flag-reference
Draft

docs: GUC and feature flag configuration reference#2
richardsimmonds wants to merge 1 commit into
mainfrom
docs/guc-feature-flag-reference

Conversation

@richardsimmonds

Copy link
Copy Markdown
Owner

Summary

DocumentDB exposes 91+ boolean feature flags and dozens of system/background-job GUC parameters with zero documentation. This PR adds docs/configuration-reference.md, a comprehensive reference table.

What is included

Four source files catalogued:

  • pg_documentdb/src/configs/feature_flag_configs.c (91 boolean feature flags)
  • pg_documentdb/src/configs/system_configs.c (system limits and enum GUCs)
  • pg_documentdb/src/configs/background_job_configs.c (TTL, index build, background worker)
  • pg_documentdb_extended_rum/core/src/rumconfigs.c (RUM index feature flags and tuning)

Format

Each entry: full GUC name, default value, scope (USERSET/SUSET/POSTMASTER), plain-English description from gettext_noop() strings, and Pending stabilization callout where applicable. SQL snippets for inspecting and changing values included.

Testing

Docs-only change. No code changes, no test impact.

Add docs/configuration-reference.md — a comprehensive reference table for
all 91+ boolean feature flags and dozens of system/background-job GUC
parameters exposed by DocumentDB under the documentdb.* prefix.

Covers four source files:
  pg_documentdb/src/configs/feature_flag_configs.c
  pg_documentdb/src/configs/system_configs.c
  pg_documentdb/src/configs/background_job_configs.c
  pg_documentdb_extended_rum/core/src/rumconfigs.c

Each entry includes the full GUC name, default value, scope (USERSET /
SUSET / POSTMASTER), and a plain-English description drawn from the
gettext_noop() strings in the source. Pending-stabilization flags are
called out explicitly so operators know which ones are safe to rely on.

Also includes SQL snippets for inspecting and changing values at runtime.

Signed-off-by: richardsimmonds <richardsimmonds314@gmail.com>
@richardsimmonds

Copy link
Copy Markdown
Owner Author

Docs Review — NEEDS CHANGES

Solid first pass. The structure is sensible, the scope key table is clear, and the SQL snippets are helpful. One blocking accuracy issue in the RUM section, plus two smaller corrections before this lands.


Blocking

RUM GUC prefix is wrong. The section header claims the RUM GUCs live "under the same documentdb. prefix (via the documentdb_rum. sub-prefix internally resolved to documentdb.)." That is not what the source shows.

DocumentDBRumInitCore in documentdb_rum_init.c:74 calls:

DocumentDBRumInitCore("documentdb_rum", "documentdb_rum");

Both rumGucPrefix and documentDBRumGucPrefix are "documentdb_rum". There is no resolution to documentdb.. The test suite confirms this consistently — e.g.:

set documentdb_rum.enable_parallel_index_build to on;
set documentdb_rum.prune_rum_empty_pages to on;
set documentdb_rum.rum_default_page_fill_factor to 100;
set documentdb_rum.enable_support_dead_index_items to on;

Every GUC name in the RUM section needs the prefix corrected:

  • documentdb.rum_fuzzy_search_limitdocumentdb_rum.rum_fuzzy_search_limit
  • documentdb.enable_parallel_index_builddocumentdb_rum.enable_parallel_index_build
  • documentdb.rum_default_page_fill_factordocumentdb_rum.rum_default_page_fill_factor
  • (same fix for all 19 RUM entries)

The opening claim "All parameters live under the documentdb. prefix" also needs qualifying — e.g.: "Most parameters live under the documentdb. prefix; the RUM index module uses the documentdb_rum. prefix (see RUM Index Configuration below)."

The pg_settings inspection query (WHERE name LIKE 'documentdb.%') will silently miss all RUM GUCs. Fix: use LIKE 'documentdb%' to cover both prefixes, or add a second OR name LIKE 'documentdb_rum.%' clause.


Minor (fix before merge)

ALTER SYSTEM SET claim is misleading. The closing note says POSTMASTER parameters "cannot be changed with ALTER SYSTEM SET at runtime." That implies the command errors out, which it does not — it writes to postgresql.auto.conf successfully; the change simply isn't applied until the next restart. Suggested wording:

"Parameters with POSTMASTER scope require a full server restart; ALTER SYSTEM SET can stage the change but pg_reload_conf() will not apply it."


Nit (no blocker)

enableSchemaEnforcementForCSFLE sits in the Auth section of the source but is categorized under Cluster Administration in the docs. Not wrong, but worth noting for anyone cross-referencing source.


Looks good

  • DCO sign-off present on the commit ✓
  • Scope key table accurate against PostgreSQL context semantics
  • Default values and ranges spot-checked against source for a representative sample: schema validation, aggregation_stages_limit (1000–5000 confirmed), tdigestCompressionAccuracy (1500 default confirmed), rum_library_load_option (PG-version-gated default confirmed), background worker scopes (enableBackgroundWorker = POSTMASTER, enableBackgroundWorkerInitJobs = POSTMASTER, enableBackgroundWorkerJobs = USERSET — all correct), vectorPreFilterIterativeScanMode enum values and default — all accurate
  • "Pending stabilization" call-outs match source comments
  • SQL snippets for inspecting and changing values are minimal and correct

Fix the RUM prefix and the ALTER SYSTEM note and this is ready.


Review by docs-reviewer (Hermes Agent)

@richardsimmonds richardsimmonds left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline comments attached — see summary comment above for the full verdict.

@@ -0,0 +1,325 @@
# DocumentDB Configuration Reference

DocumentDB exposes its settings as PostgreSQL Grand Unified Configuration (GUC)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accuracy error. "All parameters live under the documentdb. prefix" is wrong for the RUM module. DocumentDBRumInitCore is called with both prefix args set to "documentdb_rum" (documentdb_rum_init.c:74), and every test SET call uses documentdb_rum.*. Suggested fix: "Most parameters live under the documentdb. prefix; the RUM index module uses the documentdb_rum. prefix — see the RUM Index Configuration section below."

## RUM Index Configuration

The RUM index module registers its own GUCs under the same `documentdb.` prefix
(via the `documentdb_rum.` sub-prefix internally resolved to `documentdb.`).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accuracy error. This sentence says the RUM GUCs are "internally resolved to documentdb." which is not true. DocumentDBRumInitCore("documentdb_rum", "documentdb_rum") registers them directly under documentdb_rum.* with no remapping. The test suite confirms: set documentdb_rum.enable_parallel_index_build to on;, set documentdb_rum.rum_default_page_fill_factor to 100;, etc. Remove the claim about internal resolution.

### System / Tuning

| GUC name | Default | Range | Description |
|---|---|---|---|

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong prefix. Should be documentdb_rum.rum_fuzzy_search_limit. Same correction applies to all 19 GUC names in this RUM section — they all need documentdb_rum. not documentdb.


-- Persistent (requires superuser, takes effect after reload)
ALTER SYSTEM SET documentdb.maxWriteBatchSize = 50000;
SELECT pg_reload_conf();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor inaccuracy. "cannot be changed with ALTER SYSTEM SET at runtime" is misleading — the command doesn't error out. It writes to postgresql.auto.conf successfully; the change just isn't applied until a server restart. Suggested: "Parameters with POSTMASTER scope require a full server restart; ALTER SYSTEM SET can stage the change but pg_reload_conf() will not apply it."

ORDER BY name;

-- Only feature flags (boolean, non-default)
SELECT name, setting

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong prefix in query. WHERE name LIKE 'documentdb.%' misses all RUM GUCs since they live under documentdb_rum.*. Change to WHERE name LIKE 'documentdb%' or add a second clause OR name LIKE 'documentdb_rum.%'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant