Skip to content

[datafusion] add a new table for introspecting the cluster's config#4964

Open
MohamedBassem wants to merge 7 commits into
restatedev:mainfrom
MohamedBassem:feat/df-configs
Open

[datafusion] add a new table for introspecting the cluster's config#4964
MohamedBassem wants to merge 7 commits into
restatedev:mainfrom
MohamedBassem:feat/df-configs

Conversation

@MohamedBassem

@MohamedBassem MohamedBassem commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

This PR introduces a datafusion based table for introspecting configs across nodes (available over restatectl). This is meant to be a more ergonomic way for debugging config values than the USR1 signal mechanism that we have today. The implementation heavily mimics other tables in error handling, code structure, etc.

Note: Our configs can sometimes include secret tokens (e.g. S3 access tokens, etc). This PR has a best effort redaction for such secrets, however, it doesn't guarantee that it'll cover every secret. The premise here is that this table is privileged (you need access to the fabric port to query it), so it's ok to do so. If we want better guarantees, we can introduce a new Redacted<T> which always serde serializes to Redacted and use it for all of the secrets in our configs.

Example usage:

❯❯❯ cargo run -p restatectl sql "select * from configs where key LIKE '%num_retained%'"                                                  feat/df-configs
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s
     Running `target/debug/restatectl sql 'select * from configs where key LIKE '\''%num_retained%'\'''`
 PLAIN_NODE_ID  GEN_NODE_ID  KEY                            VALUE
 N1             N1:18        worker.snapshots.num-retained  1
 N3             N3:16        worker.snapshots.num-retained  1
 N2             N2:19        worker.snapshots.num-retained  1

3 rows. Query took 54.299783ms

@MohamedBassem MohamedBassem marked this pull request as draft June 23, 2026 08:06
@MohamedBassem

Copy link
Copy Markdown
Contributor Author

This is still not ready for review. Sent it out by mistake.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53bce7f974

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/storage-query-datafusion/src/configs/table.rs Outdated
@MohamedBassem MohamedBassem marked this pull request as ready for review June 23, 2026 09:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 013f94473c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/storage-query-datafusion/src/configs/table.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74516f8969

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/storage-query-datafusion/src/configs/table.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b5a3469bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/storage-query-datafusion/src/configs/table.rs Outdated

@AhmedSoliman AhmedSoliman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very cool. Excited to get this merged. Left a few comments but overall it looks good. The most notable is to add some facility to disable this table via config.

Comment thread crates/node/src/lib.rs
mod network_server;
mod roles;

use std::sync::Arc;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

❤️

Comment thread crates/storage-query-datafusion/src/config/table.rs
Comment thread crates/storage-query-datafusion/src/configs/table.rs Outdated
let schema = projection.clone();
let mut stream_builder = RecordBatchReceiverStream::builder(projection, 2);
let tx = stream_builder.tx();
let node_id = self.metadata.my_node_id();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there risk of this scanner running before the node acquiring its own node_id? If so, can we use the fallible version my_node_id_opt to avoid crashing?

If other tables already have the same risk, then it's okay to leave as is.

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.

yeah, both loglet workers and bifrost read streams seam to be reading the node_id in the beginning of the scan function as well.

Comment thread crates/storage-query-datafusion/src/configs/table.rs Outdated
Comment thread crates/storage-query-datafusion/src/configs/table.rs Outdated
self.remote_scanner_manager.clone(),
None, // local scanner is registered separately by the node
)?;
crate::configs::register_self(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can imagine scenarios where we might want to disable access to this table. Can we let this be controlled by a config option? (enabled by default though).

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.

Where do you think would be a good section to place this knob? admin.query_engine?

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d61fa21823

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/// against the hyphenated forms here.
fn is_potentially_secret(key: &str) -> bool {
let key = key.to_ascii_lowercase();
[

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Redact private-key config entries

Fresh evidence beyond the earlier redaction comments is that Kafka additional_options can carry arbitrary librdkafka keys (crates/types/src/config/kafka.rs:30-35), and librdkafka defines ssl.key.pem and sasl.oauthbearer.assertion.private.key.pem as client private-key strings (Confluent docs). Flattened keys such as ingress.kafka-clusters[0].ssl.key.pem contain none of the current needles, so the config table returns the PEM material unredacted; please include private-key/key-pem style names or redact these option maps more conservatively.

Useful? React with 👍 / 👎.

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.

2 participants