Skip to content

Commit

Permalink
Fix updating "trace_read_requests" with /v1/tenant/config mgmt API.
Browse files Browse the repository at this point in the history
The new "trace_read_requests" option was missing from the
parse_toml_tenant_conf function that reads the config file. Because of
that, the option was ignored, which caused the test_read_trace.py test
to fail. It used to work before commit 9a6c0be, because the
TenantConfigOpt struct was constructed directly in tenant_create_handler,
but now it is saved and read back from disk even for a newly created
tenant.

The abovementioned bug was fixed in commit 0939327 already, which
added the missing code to parse_toml_tenant_conf() to parse the
new "trace_read_requests" option. This commit fixes one more function
that was missed earlier, and adds more detail to the error message if
parsing the config file fails.
  • Loading branch information
hlinnaka committed Dec 7, 2022
1 parent c74dca9 commit a46a81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pageserver/src/tenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ impl Tenant {
let tenant_conf = match Self::load_tenant_config(conf, tenant_id) {
Ok(conf) => conf,
Err(e) => {
error!("load tenant config failed: {}", e);
error!("load tenant config failed: {:?}", e);
return Tenant::create_broken_tenant(conf, tenant_id);
}
};
Expand Down
3 changes: 3 additions & 0 deletions pageserver/src/tenant_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ impl TenantConfOpt {
if let Some(max_lsn_wal_lag) = other.max_lsn_wal_lag {
self.max_lsn_wal_lag = Some(max_lsn_wal_lag);
}
if let Some(trace_read_requests) = other.trace_read_requests {
self.trace_read_requests = Some(trace_read_requests);
}
}
}

Expand Down

0 comments on commit a46a81b

Please sign in to comment.