Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When running kafka-metadata-quorum script to get the quorum replication status, the LastFetchTimestamp and LastCaughtUpTimestamp output is not human-readable.

I will It would be convenient to add an optional flag (-hr, --human-readable) to enable a human-readable format showing the operation delay in ms (i.e. 366 ms ago).

This dealy delay is computed as (now - timestamp), where they are both represented as Unix time (UTC based).

...

A new optional flag called --human-readable with the shortcut -hr will be added to the kafka-metadata-quorum tool.

Code Block
languagebash
$ bin/kafka-metadata-quorum.sh describe -h
usage: kafka-metadata-quorum [-h] --bootstrap-server BOOTSTRAP_SERVER describe [-h] [-command-config COMMAND_CONFIGstatus] [--replication] [-hr] {describe} ...

This tool describes kraft metadata quorum status.

positional arguments:
  {describe}
    describe             Describe the metadata quorum info

-human-readable]

optional arguments:
  -h, --help             show this help message and exit

Status:
  --bootstrap-server BOOTSTRAP_SERVER
status               A short summary of the quorum status and the other provides Adetailed comma-separated list of host:port pairs to use for establishing the connection to the Kafka cluster.information about the status of replication.

Replication:
  --command-config COMMAND_CONFIG
replication          Detailed information about the status            Property file containing configs to be passed to Admin Client.
  -hr,of replication
  --human-readable      Print humanHuman-readable timestamps (default: false)output

Proposed Changes

The current default --replication output is as follows and will remain unchanged.

...

Instead, when passing the new flag, we will have the following output (note how argparse4j support abbreviations).

Code Block
languagebash
$ bin/kafka-metadata-quorum.sh --bootstrap-server :9092 -hr describe --replication --human-readable
NodeId	LogEndOffset	Lag	LastFetchTimestamp	LastCaughtUpTimestamp	Status  	
2     	541 8689        	0  	34 ms ago          	34 ms ago             	Leader  	
3     	5418689         	0  	366148 ms ago        	366148 ms ago           	Follower	
4     	541 8689        	0  	366148 ms ago        	366148 ms ago           	Follower


$ bin/kafka-metadata-quorum.sh --bootstrap-serverboot :9092 describe --human-readable describere --replicationhu
NodeId	LogEndOffset	Lag	LastFetchTimestamp	LastCaughtUpTimestamp	Status  	
2     	54161          	0  	35 ms ago          	35 ms ago             	Leader  	
3     	54161          	0  	36656 ms ago         	36656 ms ago            	Follower	
4     	54161          	0  	36656 ms ago         	36656 ms ago            	Follower

Compatibility, Deprecation, and Migration Plan

...