Add id info to config check utility#3141
Conversation
|
A question before merging - When passing the ID, if it is not namespace or table, then I pass null and assume that means system config for the log statement. General question is that correct or would something other than system be better displayed in the log statement. |
|
So, given the levels of configuration (default, system, site, namespace, table), the default configuration can't be invalid. Is there a way to differentiate between the system and site configs? Edit: Looking at the code, you might need to call ConfigCheckUtil.validate in the SystemConfiguration constructor passing in |
|
I don't think so without major changes (and maybe not then) - but in this context I think that site, namespace and table are the only ones that matter - that is, they are the only ones users can control. Default and system are our responsibility and need to be correct in the code - this change is to log the id's so that users can see where BAD CONFIG errors are occurring. |
|
The code could be modified to pass a string instead of Id to allow more flexibility, |
| deleteWatcher); | ||
| var conf = new NamespaceConfiguration(context, namespaceId, getSystemConfiguration()); | ||
| ConfigCheckUtil.validate(conf); | ||
| ConfigCheckUtil.validate(conf, namespaceId.toString()); |
There was a problem hiding this comment.
Since these are strings, I think I would have preferred something like:
ConfigCheckUtil.validate(conf, "Namespace id: " + namespaceId);So we know it's a namespace and not a table ID. Same with the table IDs.
The
ConfigCheckUtil.validatefunction logs issues with properties, but does not include an id to help find where the issue is occurring. This PR adds the namespace or table id - or if an id is not provided, it assumes the property is from the site configuration.This was noticed after upgrading a 2.1 instance with replication configured. PR #3137 is independent of these changes, but this PR does provide additional information once upgrades are possible with PR #3137
Before the changes, the logs looks like:
With these changes: