Skip to content

Completed functionality for admin check command#5348

Merged
kevinrr888 merged 17 commits intoapache:mainfrom
kevinrr888:3.1-feature-4892-part2
Feb 4, 2026
Merged

Completed functionality for admin check command#5348
kevinrr888 merged 17 commits intoapache:mainfrom
kevinrr888:3.1-feature-4892-part2

Conversation

@kevinrr888
Copy link
Member

@kevinrr888 kevinrr888 commented Feb 21, 2025

New checks for admin check command

  • Implemented SYSTEM_CONFIG check:
    • Checks ZooKeeper locks for Accumulo server processes
    • Checks ZooKeeper table nodes
    • Checks that the WAL metadata in ZooKeeper is valid
  • Added new SERVER_CONFIG check:
    • Checks that all configured properties are valid
    • Checks that required properties are present in the config
  • Added new tests in AdminCheckIT for SYSTEM_CONFIG and SERVER_CONFIG. Added failing test cases for all checks.
  • Updated description for admin check run command functionality #4892. This describes all the checks thus far for the new accumulo admin check command. See this for the complete functionality of the command.
  • Considered adding check to MetadataConstraints to ensure tablets reference files that actually exist (i.e., in MetadataConstraints.validateDataFileMetadata, check that stf.getPath() exists in HDFS). This would make sure the file exists before the mutation is ever written and would also check that it exists when we run the admin check command for metadata (root metadata, root table, and metadata table): see MetadataCheckRunner.checkColumns(). However, this led to a ComprehensiveIT test failure, so I assume the file may not always exist before the metadata for it is written...
  • Deleted CheckServerConfig (run via accumulo check-server-config) as the new accumulo admin check run SERVER_CONFIG will inherently do the same checks. Maybe we don't want to completely get rid of this check yet. Maybe it would be better to have the check just output that the check has moved under accumulo admin check?
  • There were a couple other existing check commands that I originally considered moving under this new admin command (CheckAccumuloProperties and CheckCompactionConfig), however, their usage is specifically to check a file irrespective of any running Accumulo instance, so I did not feel it would make sense to move these under the new admin command.

This PR along with #4957 closes #4892

- Implemented SYSTEM_CONFIG check:
	- Checks ZooKeeper locks for Accumulo server processes
	- Checks ZooKeeper table nodes
	- Checks that the WAL metadata in ZooKeeper is valid
- Added new SERVER_CONFIG check:
	- Checks that all configured properties are valid
	- Checks that required properties are present in the config
- Added new tests in `AdminCheckIT` for SYSTEM_CONFIG and SERVER_CONFIG. Added failing test cases for all checks.
- Deleted CheckServerConfig (run via `accumulo check-server-config`) as the new `accumulo admin check run SERVER_CONFIG` will inherently do the same checks.
Comment on lines 55 to 67
// there are many properties that should be set (default value or user set), identifying them
// all and checking them here is unrealistic. Some property that is not set but is expected
// will likely result in some sort of failure eventually anyway. We will just check a few
// obvious required properties here.
Set<Property> requiredProps = Set.of(Property.INSTANCE_ZK_HOST, Property.INSTANCE_ZK_TIMEOUT,
Property.INSTANCE_SECRET, Property.INSTANCE_VOLUMES, Property.GENERAL_THREADPOOL_SIZE,
Property.GENERAL_DELEGATION_TOKEN_LIFETIME,
Property.GENERAL_DELEGATION_TOKEN_UPDATE_INTERVAL, Property.GENERAL_IDLE_PROCESS_INTERVAL,
Property.GENERAL_LOW_MEM_DETECTOR_INTERVAL, Property.GENERAL_LOW_MEM_DETECTOR_THRESHOLD,
Property.GENERAL_PROCESS_BIND_ADDRESS, Property.GENERAL_SERVER_LOCK_VERIFICATION_INTERVAL,
Property.MANAGER_CLIENTPORT, Property.TSERV_CLIENTPORT, Property.GC_CYCLE_START,
Property.GC_CYCLE_DELAY, Property.GC_PORT, Property.MONITOR_PORT, Property.TABLE_MAJC_RATIO,
Property.TABLE_SPLIT_THRESHOLD);
Copy link
Member Author

Choose a reason for hiding this comment

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

any other important ones I left out? Any I shouldn't have included?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not a change for this PR, but wondering if this should be pushed to the validation code of each property. For example could we attempt to do something like the following in addition to the code that goes through the defined props above. Thinking if a props validation fails on null or empty string then its "required" and should be set. Looking at some of the important props, like instance.volumes their types would need change from something besides STRING that is more specific, which would be a good general change to make (would be good to have specific type to do validation for instance volumes and that could include not accepting empty string).

    for(var prop : Property.values()) {
      var value = config.get(prop);
      if (!Property.isValidProperty(prop.getKey(), value)) {
        log.warn("Invalid property (key={} val={}) found in the config", prop, value);
      }
    }

If the rest of the code worked like this, then would not need this list here.

Copy link
Contributor

Choose a reason for hiding this comment

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

As the code is currently written it loops over all the props the loop in the prev comment may not work well because the get method replaces w/ the default value when not present.

In general it seems like it would be best to move the concept of a required property into the Property class in some form. Then the entire system could react appropriately when a required property is not present and is requested. For now a list in this class seems fine.

I experimented w/ validating the volume prop in #5365 based on the exploration done as part of this.

Copy link
Member Author

Choose a reason for hiding this comment

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

This sounds like a good idea to me. There are a lot of PropertyType.STRING when a String isn't really what the property is. PropertyType exists to check that the property is valid; setting the PropertyType to STRING is just a way to ignore this validation. I wonder if it would be best for a 1 to 1 mapping Property to PropertyType. This would probably be overkill though, another idea could be to analyze the PropertyTypes that are always valid. From briefly looking, PropertyType.PATH, PropertyType.STRING, PropertyType.URI are always valid. I don't think any properties should always be valid. Those that are PropertyType.STRING could probably be given a more appropriate existing PropertyType or a new one. PATH and URI could have validation.

In addition to this, can analyze all properties, determine if they are required or not, and change the validation:

  • Properties that are not required could accept empty string, null, or a valid value (where validity is well defined)
  • Properties that are required could only accept a valid value

Like you said, for this PR, can just push this list of required properties into Property. Maybe for now/in this PR this list of required props is only accessed/checked in this admin check. Might be a bit of a scope creep to start checking this list elsewhere in the code. Could do it in follow on.

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely want to avoid any scope creep in this PR. Identified some areas that need improvement based on this work, we can open follow on issues or PRs for those.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could leave the list as is in the PR. For follow on issues, do we need two issues? One for addressing the STRING types and another for somehow representing and documenting required props in the Property.java?

Copy link
Member Author

@kevinrr888 kevinrr888 Feb 28, 2025

Choose a reason for hiding this comment

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

I think either would be fine, but it might be easier as just one issue. There would be overlap in these changes so might be hard to split up/work on as two separate issues/PRs. For example, instance.volumes would need to be a required property (which would be tied to validation in it's PropertyType) and would need to be moved away from PropertyType.STRING

@kevinrr888 kevinrr888 self-assigned this Feb 21, 2025
@kevinrr888 kevinrr888 added this to the 3.1.0 milestone Feb 21, 2025
@kevinrr888 kevinrr888 linked an issue Feb 21, 2025 that may be closed by this pull request
10 tasks
@kevinrr888 kevinrr888 changed the title New checks for admin check command Completed functionality for admin check command Feb 24, 2025
@ctubbsii ctubbsii changed the base branch from 3.1 to main March 13, 2025 23:51
@ctubbsii ctubbsii modified the milestones: 3.1.0, 4.0.0 Mar 13, 2025
@kevinrr888
Copy link
Member Author

kevinrr888 commented Mar 25, 2025

@keith-turner - Could you take another look at this when you get the chance? I've updated this to work for 4.0. Since there's no more 3.x, this should make things simpler here. Main things changed in latest commit were:

There are also some outstanding comments/questions

- RPC_PROCESS_BIND_ADDRESS was added as a required property in the
  server config check, but this prop does not need to be set. Removed
this from the required properties
- Fixed some flaky assertions
@keith-turner
Copy link
Contributor

Noticed #6078 and #6079 while looking at this.

Copy link
Contributor

@dlmarion dlmarion left a comment

Choose a reason for hiding this comment

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

LGTM. I think @keith-turner had some other comments too. Suggest waiting for his approval also before merging.

kevinrr888 and others added 3 commits February 4, 2026 12:49
…kCommand/SystemConfigCheckRunner.java

Co-authored-by: Keith Turner <kturner@apache.org>
…kCommand/SystemConfigCheckRunner.java

Co-authored-by: Keith Turner <kturner@apache.org>
@kevinrr888 kevinrr888 merged commit be9b1fd into apache:main Feb 4, 2026
8 checks passed
@kevinrr888 kevinrr888 deleted the 3.1-feature-4892-part2 branch February 4, 2026 19:25
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.

admin check run command functionality

5 participants