Repository navigation
Description
Motivation
- Defaults are invisible.
sys.server_propertieslists only properties that are explicitly set. You can't see defaults, unset properties, or values a getter normalizes:druid.indexer.tasklock.batchAllocationNumThreads=0actually runs as1. - Configuration is hard to find. Properties are scattered across docs, extension pages, and code, and some are undocumented.
- Tools and agents need the real configuration of the running version, not remembered docs.
Proposed changes
Add a system table, sys.configuration, with one row per configuration property per process, including properties that aren't set, showing the configured, effective, and default values.
SET useDruidEngineForSystemTables = TRUE;
SELECT server, property, configured_value, effective_value, default_value, is_changed
FROM sys.configuration
WHERE property LIKE 'druid.sql.planner.%'Columns
| Column | Type | Description |
|---|---|---|
server |
VARCHAR | Host and port |
service_name |
VARCHAR | Service name |
node_roles |
VARCHAR | Roles of the process |
property |
VARCHAR | Full property name |
config_class |
VARCHAR | Java class that holds the property |
value_type |
VARCHAR | Declared Java type |
value_source |
VARCHAR | PROPERTY (set directly), PARENT_JSON (set inside a parent key's JSON), or DEFAULT (not set) |
configured_value |
VARCHAR | Text as written in the runtime properties, before ${...} substitution |
effective_value |
VARCHAR | Value the process is using |
default_value |
VARCHAR | Value from the config class when nothing is set |
is_changed |
LONG | 1 if the effective value differs from the default |
is_redacted |
LONG | 1 if values are hidden because the property is sensitive |
status |
VARCHAR | AVAILABLE, NOT_INITIALIZED, UNSUPPORTED, CONFLICT, or ERROR |
error_message |
VARCHAR | Generic diagnostic |
How it works
- Discovery. Each process lists the properties of every config class bound through
JsonConfigProvider, using the same Jackson metadataJsonConfiguratoruses to read them. No existing config class orbindcall changes. - Values. The effective value is read from the config object's getter, so normalization is visible. The default value comes from building the config class with no properties set. Configs the process has never used aren't created: they show
NOT_INITIALIZED, but still have defaults. is_changedis computed on the node by comparing typed values, so formatting differences such asPT60SvsPT1Mdon't count.- Redaction. Values are hidden for properties matched by
druid.server.hiddenProperties(the rule/status/propertiesuses) and for secret types such asPasswordProvider. Credentials inside URLs are stripped. - Execution. Built on the native system-table framework from feat(sql): add experimental native query support for system tables #20183, so no new API is added. Reading the table requires CONFIG READ, the same as
/status/properties.
Detailed semantics
Discovery
- Walks both the service injector and the startup injector, which holds
druid.extensions.*,druid.modules.*, anddruid.expressions.*.ServerInjectorBuilderbinds the startup injector so the inspector can reach it. Overridden bindings are excluded. JsonConfigProvidergets read-only accessors for its property base, config class, default class, and initialized instance; its instance field becomesvolatile.- Nested beans are expanded. For polymorphic configs such as
druid.cache, thetyperow and the leaves of the selected subtype are listed.
Values
configured_valueis read withProperties.getPropertyand is not parsed, soPT2MstaysPT2M. It is null when the exact key isn't set, the row is redacted, or the type is unsupported.effective_valueis read from the getter, else the field. Supported types: primitives, strings, enums,Duration,Period,HumanReadableBytes, and collections of these. Other types areUNSUPPORTED. Serializers are never called.value_source: when both the exact key and a parent JSON key set a leaf,JsonConfiguratorapplies them in undefined order, so the row showsPARENT_JSONandeffective_valueis authoritative.
Defaults
- Built lazily, the way
JsonConfiguratorwould with no properties: the provider's default class if it has one, else{}deserialized into the class. Polymorphic configs use{"type": <selected subtype>}. - Injection is limited to objects that already exist or are free to create: constants, already-initialized configs, and
RuntimeInfo. Anything else is refused and the config has no default; if it was waiting on an uninitialized config, it is retried later. - A construction, injection, or validation failure means no default. It never fails the row.
- Host-derived defaults, such as the thread count from
RuntimeInfo, can differ between nodes.
is_changed
- Compares Java values with collection equality. A
Periodwithout years or months compares by duration. - Null when unknown:
ERROR,CONFLICT,NOT_INITIALIZED,UNSUPPORTED, or no default. A property explicitly set to its default is0. - Also computed for redacted rows, where it reveals only whether the secret equals its public default.
Status
- Precedence:
ERROR>CONFLICT>NOT_INITIALIZED>UNSUPPORTED>AVAILABLE. CONFLICT: bindings that share a path, such asClientandEscalatedClient, disagree on type, effective value, or default value. Effective and default values are hidden.ERROR: a getter failed, or the node was unreachable. A node-failure row carries only the node identity and a generic message.
Redaction
- By name:
SensitiveProperties. By type:PasswordProvider,DynamicConfigProvider, and write-only properties. - By value: URL userinfo and
password/pwdparameters are stripped. These rows keepis_redacted = 0. - Error messages are always generic.
Execution
- Components:
ConfigurationTableDescriptorandConfigurationTableDataProviderinserver,SystemConfigurationTableinsql. - Only connection failures become
ERRORrows. Other node errors fail the query. - With
druid.auth.authorizeSystemTablesDirectly,SYSTEM_TABLEREAD onconfigurationis also required. - Requires the framework to be enabled (
druid.query.enableDruidEngineForSystemTablesanduseDruidEngineForSystemTables). There is no fallback.
Rationale
- Why not extend
sys.server_properties? It can't show defaults, and changing its rows would break existing queries. - Why not a new endpoint? feat(sql): add experimental native query support for system tables #20183 already provides transport, authorization, and cancellation for system tables.
Operational impact
- A new experimental system table that requires CONFIG READ. No new endpoints and no change to existing behavior.
- Depends on feat(sql): add experimental native query support for system tables #20183 and is opt-in with it. During a rolling upgrade, keep
useDruidEngineForSystemTablesoff until all services are upgraded. - Core changes: read-only accessors on
JsonConfigProvider, and one binding inServerInjectorBuilder. - Not covered: properties read directly from
Properties,bindInstanceobjects, dynamic configs, task specs, unloaded extensions, unselected polymorphic subtypes, and loaded keys that match no config, such as typos or removed properties. Those keys remain visible insys.server_properties.
Future work
- Generate the configuration docs from config metadata, as
QueryContextParametersandParameterDocumentationGeneratordo for query context parameters. A build check would catch docs that drift from code, and the same metadata could adddescriptionandsincecolumns.
Example use
On every upgrade, users, or an agent acting for them, can capture all configuration properties that differ from the defaults and compare them with the result from the previous release, to confirm that every change is expected:
SET useDruidEngineForSystemTables = TRUE;
SELECT server, property, effective_value, default_value, status
FROM sys.configuration
WHERE is_changed = 1 OR status = 'ERROR'Including ERROR rows keeps an unreachable node from looking unchanged. Capturing default_value for all rows, without the filter, and comparing it across the upgrade also catches changes to code defaults.
This catches changes that are easy to miss. For example, #19115 set druid.sql.planner.metadataSegmentPollPeriod=5000 in every bundled Broker runtime.properties, which Docker images and quickstart use. The default in code and in the docs is still 60000. After upgrading, such deployments poll the Coordinator 12 times as often, and nothing announces it. The query returns that row with effective 5000 and default 60000.
Activity