Skip to content

Add system properties table#18692

Merged
kfaraz merged 29 commits intoapache:masterfrom
GabrielCWT:gh-65-add-sys-properties
Nov 20, 2025
Merged

Add system properties table#18692
kfaraz merged 29 commits intoapache:masterfrom
GabrielCWT:gh-65-add-sys-properties

Conversation

@GabrielCWT
Copy link
Copy Markdown
Contributor

This PR adds a new properties table which will call the /status/properties endpoint of each of the nodes.

The feature allows for an aggregated view of the properties of all services.

@GabrielCWT GabrielCWT changed the title Add properties table Add system properties table Oct 24, 2025
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, @GabrielCWT !
I have often found myself needing this.
Overall approach makes sense to me.
Please add an embedded test for this feature (see IngestionSmokeTest for an example).

Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java Outdated
Comment thread sql/src/test/java/org/apache/druid/sql/calcite/schema/SystemSchemaTest.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
@GabrielCWT
Copy link
Copy Markdown
Contributor Author

Hi @kfaraz, when implementing the embedded test, I encountered a strange bug which I could not pinpoint the issue. I'm hoping you have more insight on this issue.

When sending the /status/properties request to the coordinator's localhost:8081, it would return the broker's properties. I confirmed that the coordinator was initialising it's own StatusResource and Properties object.

It seems like the coordinator is hitting the broker's endpoint even though I am using localhost:8081.

When I added a router server, the coordinator would return the router's properties instead.

  protected EmbeddedDruidCluster createCluster()
  {
    return EmbeddedDruidCluster
        .withZookeeper()
        .addServer(new EmbeddedCoordinator())
        .addServer(overlord)
        .addServer(broker)
        .addServer(new EmbeddedRouter()) // added here
        .addCommonProperty("commonProperty", "commonValue");
  }

Note: Currently I have omitted verifying the coordinator's properties in the embedded test for the reason above.

@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Oct 29, 2025

Thanks for the update, @GabrielCWT . I will take a look at the test.

Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Left some more comments.

@GabrielCWT , to fix the test, please
change this line

final FilterHolder guiceFilterHolder = JettyServerInitUtils.getGuiceFilterHolder(injector);
root.addFilter(GuiceFilter.class, "/status/*", null);

to be the following instead:

final FilterHolder guiceFilterHolder = JettyServerInitUtils.getGuiceFilterHolder(injector);
root.addFilter(guiceFilterHolder, "/status/*", null);

I must have missed this one while fixing up the rest for the embedded test framework.

Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Copy link
Copy Markdown
Member

@FrankChen021 FrankChen021 left a comment

Choose a reason for hiding this comment

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

LGTM with a minor suggestion

Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
* that server would have multiple values in the column {@code node_roles} rather than duplicating all the
* rows.
*/
public class SystemPropertiesTable extends AbstractTable implements ScannableTable
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we call this ServerPropertiesTable to be clearer? (similar to ServerSegmentsTable for server_segments table)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will rename it to SystemServerPropertiesTable instead to maintain the idea that it is a system table

@abhishekrb19
Copy link
Copy Markdown
Contributor

This is cool! The hidden or secret properties on each server wouldn’t be listed in this systems table as it goes through the /status/properties, right? I think it would be good to add a test for that. Could you also please update the docs for this table here https://druid.apache.org/docs/latest/querying/sql-metadata-tables/#system-schema?

Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Left some minor suggestions. Changes look good.

Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Comment thread sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemPropertiesTable.java Outdated
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

We should also add the test suggested by @abhishekrb19 , but that is not a blocker for this PR and can be done in a follow up.

Thanks for the changes, @GabrielCWT !

Comment thread docs/querying/sql-metadata-tables.md Outdated
Comment thread docs/querying/sql-metadata-tables.md Outdated
@GabrielCWT
Copy link
Copy Markdown
Contributor Author

We should also add the test suggested by @abhishekrb19 , but that is not a blocker for this PR and can be done in a follow up.

@kfaraz I've added a minimal test to check if hidden properties are exposed.

Also do we still need tests in SystemSchemaTest since we implemented the tests in SystemServerPropertiesTableTest?

@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Nov 4, 2025

@kfaraz I've added a minimal test to check if hidden properties are exposed.

Thanks, @GabrielCWT !

Also do we still need tests in SystemSchemaTest since we implemented the tests in SystemServerPropertiesTableTest?

Yes, since you have already added those UTs, let's keep them.
Embedded tests are primarily for integration testing.
Method/class level functional testing should still be done in UTs.

@FrankChen021 FrankChen021 reopened this Nov 6, 2025
Comment thread docs/querying/sql-metadata-tables.md Outdated
@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Nov 20, 2025

@FrankChen021 , @GabrielCWT , are any further changes pending in this PR?

@GabrielCWT
Copy link
Copy Markdown
Contributor Author

No other changes @kfaraz

@kfaraz kfaraz merged commit 3e4c5cc into apache:master Nov 20, 2025
84 of 85 checks passed
@kgyrtkirk kgyrtkirk added this to the 36.0.0 milestone Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants