KAFKA-19681 Improve MetadataShell tool by skipping missing children and removing zkMigrationState (#20504)

The current `metadata-shell` find command throws an exception due to
child node `zkMigrationState`.
This interrupts the output and makes the CLI less usable.

Additionally, `zkMigrationState` is no longer used in Kafka 4.x, but it
is still defined under image/features, which causes misleading error
messages.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Ken Huang 2025-09-21 12:35:46 +08:00 committed by GitHub
parent 5919762009
commit 07b786e5bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 6 deletions

View File

@ -34,11 +34,6 @@ public class FeaturesImageNode implements MetadataNode {
*/ */
public static final String METADATA_VERSION = "metadataVersion"; public static final String METADATA_VERSION = "metadataVersion";
/**
* The name of the zk migration state child node.
*/
public static final String ZK_MIGRATION_STATE = "zkMigrationState";
/** /**
* The prefix to put before finalized feature children. * The prefix to put before finalized feature children.
*/ */
@ -57,7 +52,6 @@ public class FeaturesImageNode implements MetadataNode {
public Collection<String> childNames() { public Collection<String> childNames() {
ArrayList<String> childNames = new ArrayList<>(); ArrayList<String> childNames = new ArrayList<>();
childNames.add(METADATA_VERSION); childNames.add(METADATA_VERSION);
childNames.add(ZK_MIGRATION_STATE);
for (String featureName : image.finalizedVersions().keySet()) { for (String featureName : image.finalizedVersions().keySet()) {
childNames.add(FINALIZED_PREFIX + featureName); childNames.add(FINALIZED_PREFIX + featureName);
} }