Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pulsar-admin] allow to get ledger metadata along with topic stats-internal #8180

Merged
merged 3 commits into from
Oct 2, 2020

Conversation

rdhabalia
Copy link
Contributor

Motivation

Pulsar-admin api and CLI utility is a tool used for operational and system debugging purpose. pulsar-admin topics stats-internal command gives internals of the topic and it also shows list of ledgers where data has been written. However, sometimes operation team wants to know more details about ledgers such as : number of ensembles and list of bookies which own the ledger to find out issue with faulty bookie. right now, we have to use zookeeper-shell utility and read znode value to fetch such information.
So, it would be useful if ledger-info also has ledger-metadata and we can get it from pulsar-admin CLI.

Modification

  • Added ledger metadata into ledger-info response of the topics stats-internal command.
  • user can pass additional flag to add ledger metadata else user will not see any change in output of topics stats-internal

Result

./bin/pulsar-admin persistent stats-internal <topic> -m
:
 {
    "ledgerId" : 23,
    "entries" : 200,
    "size" : 11100,
    "offloaded" : false,
    "metadata" : "LedgerMetadata{formatVersion=3, ensembleSize=2, writeQuorumSize=2, ackQuorumSize=2, state=CLOSED, length=11100, lastEntryId=199, digestType=CRC32C, password=OMITTED, ensembles={0=[1.1.1.1:3182, 2.2.2.2:3181], 100=[1.1.1.1:3182, 3.3.3.3:3181]}, customMetadata={component=base64:bWFuYWdlZC1sZWRnZXI=, pulsar/managed-ledger=base64:c2FtcGxlL3N0YW5kYWxvbmUvbnMxL3BlcnNpc3RlbnQvdDE=}}"
  }

@rdhabalia
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@rdhabalia
Copy link
Contributor Author

/pulsarbot run-failure-checks

@rdhabalia
Copy link
Contributor Author

/pulsarbot run-failure-checks

@sijie sijie merged commit f3f82dd into apache:master Oct 2, 2020
lbenc135 pushed a commit to lbenc135/pulsar that referenced this pull request Oct 3, 2020
…ternal (apache#8180)

### Motivation

Pulsar-admin api and CLI utility is a tool used for operational and system debugging purpose. `pulsar-admin topics stats-internal` command gives internals of the topic and it also shows list of ledgers where data has been written. However, sometimes operation team wants to know more details about ledgers such as : number of ensembles and list of bookies which own the ledger to find out issue with faulty bookie. right now, we have to use zookeeper-shell utility and read znode value to fetch such information. 
So, it would be useful if ledger-info also has ledger-metadata and we can get it from pulsar-admin CLI.

### Modification
- Added ledger metadata into ledger-info response of the `topics stats-internal` command.
- user can pass additional flag to add ledger metadata else user will not see any change in output of `topics stats-internal`

### Result
```
./bin/pulsar-admin persistent stats-internal <topic> -m
:
 {
    "ledgerId" : 23,
    "entries" : 200,
    "size" : 11100,
    "offloaded" : false,
    "metadata" : "LedgerMetadata{formatVersion=3, ensembleSize=2, writeQuorumSize=2, ackQuorumSize=2, state=CLOSED, length=11100, lastEntryId=199, digestType=CRC32C, password=OMITTED, ensembles={0=[1.1.1.1:3182, 2.2.2.2:3181], 100=[1.1.1.1:3182, 3.3.3.3:3181]}, customMetadata={component=base64:bWFuYWdlZC1sZWRnZXI=, pulsar/managed-ledger=base64:c2FtcGxlL3N0YW5kYWxvbmUvbnMxL3BlcnNpc3RlbnQvdDE=}}"
  }
```
@rdhabalia rdhabalia deleted the ml_info branch October 5, 2020 16:40
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Nov 13, 2020
…ternal (apache#8180)

### Motivation

Pulsar-admin api and CLI utility is a tool used for operational and system debugging purpose. `pulsar-admin topics stats-internal` command gives internals of the topic and it also shows list of ledgers where data has been written. However, sometimes operation team wants to know more details about ledgers such as : number of ensembles and list of bookies which own the ledger to find out issue with faulty bookie. right now, we have to use zookeeper-shell utility and read znode value to fetch such information. 
So, it would be useful if ledger-info also has ledger-metadata and we can get it from pulsar-admin CLI.

### Modification
- Added ledger metadata into ledger-info response of the `topics stats-internal` command.
- user can pass additional flag to add ledger metadata else user will not see any change in output of `topics stats-internal`

### Result
```
./bin/pulsar-admin persistent stats-internal <topic> -m
:
 {
    "ledgerId" : 23,
    "entries" : 200,
    "size" : 11100,
    "offloaded" : false,
    "metadata" : "LedgerMetadata{formatVersion=3, ensembleSize=2, writeQuorumSize=2, ackQuorumSize=2, state=CLOSED, length=11100, lastEntryId=199, digestType=CRC32C, password=OMITTED, ensembles={0=[1.1.1.1:3182, 2.2.2.2:3181], 100=[1.1.1.1:3182, 3.3.3.3:3181]}, customMetadata={component=base64:bWFuYWdlZC1sZWRnZXI=, pulsar/managed-ledger=base64:c2FtcGxlL3N0YW5kYWxvbmUvbnMxL3BlcnNpc3RlbnQvdDE=}}"
  }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants