Skip to content

documentdb_bg_worker_database_name parameter uses prefix incorrectly #239

Open
@AlekSi

Description

@AlekSi
Contributor

Describe the bug

documentdb_bg_worker_database_name should be documentdb.bg_worker_database_name, with a dot instead of an underscore. Using underscore makes changing this parameter impossible because of the reserved prefix.

DefineCustomStringVariable(
psprintf("%s_bg_worker_database_name", prefix),
gettext_noop("Database to which background worker will connect."),
NULL,
&BackgroundWorkerDatabaseName,
DEFAULT_BG_DATABASE_NAME,
PGC_POSTMASTER,
GUC_SUPERUSER_ONLY,
NULL, NULL, NULL);
DefineCustomIntVariable(
psprintf("%s.bg_worker_latch_timeout", prefix),
gettext_noop("Latch timeout inside main thread of bg worker leader."),
NULL,
&LatchTimeOutSec,
DEFAULT_BG_LATCH_TIMEOUT_SEC,
0,
200,
PGC_POSTMASTER,
GUC_SUPERUSER_ONLY,
NULL, NULL, NULL);

Note how the first parameter uses an underscore while the second (and all others) use a dot.

MarkGUCPrefixReserved("documentdb");
InitializeDocumentDBBackgroundWorker("pg_documentdb", "documentdb", "documentdb");

Environment

Any.

Reproduction Steps

  1. Try to set documentdb_bg_worker_database_name in a configuration file.
  2. Get unrecognized configuration parameter "documentdb_bg_worker_database_name" error.

Expected behavior

It is possible to change the database name.

Actual behavior

It is not possible to change the database name.

Additional context

FerretDB/FerretDB#5278

Activity

added a commit that references this issue on Jun 20, 2025
26a5bfb
linked a pull request that will close this issue on Jun 20, 2025
visridha

visridha commented on Jun 25, 2025

@visridha
Contributor

@lucasbfernandes to take a look

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @AlekSi@lucasbfernandes@visridha

    Issue actions

      `documentdb_bg_worker_database_name` parameter uses prefix incorrectly · Issue #239 · microsoft/documentdb