Fix vitastor-cli ls-pgs DEGRADED column and lost errors #99

Closed
koolkhel wants to merge 2 commits from koolkhel/vitastor:cli-ls-pgs into master
Contributor

Description

  • Fix vitastor-cli ls-pgs DEGRADED column showing misplaced data. The table column used the fmt_misplaced key, so it repeated MISPLACED: PGs with 64 degraded objects showed DEGRADED 0 B. The JSON output was correct.
  • Fix vitastor-cli ls-pgs printing an empty table instead of an error. When the pool was not found or the etcd request failed, loop() still ran format_pgs(), which replaced the error with a table built from the pool config: ls-pgs --pool nosuchpool printed only the table header instead of "Pool nosuchpool not found".

Tested: new tests/test_pg_ls.sh covers both; each check fails without its fix and passes with it.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description - **Fix vitastor-cli ls-pgs DEGRADED column showing misplaced data.** The table column used the `fmt_misplaced` key, so it repeated MISPLACED: PGs with 64 degraded objects showed `DEGRADED 0 B`. The JSON output was correct. - **Fix vitastor-cli ls-pgs printing an empty table instead of an error.** When the pool was not found or the etcd request failed, `loop()` still ran `format_pgs()`, which replaced the error with a table built from the pool config: `ls-pgs --pool nosuchpool` printed only the table header instead of "Pool nosuchpool not found". Tested: new tests/test_pg_ls.sh covers both; each check fails without its fix and passes with it. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 2 commits 2026-10-25 16:14:53 +03:00
The DEGRADED column of the ls-pgs table used the fmt_misplaced key, so
it repeated MISPLACED and never showed degraded data. The JSON output
was correct.
When the pool was not found or the etcd request failed, load_pg_stats()
stored the error, but loop() still ran format_pgs() which replaced the
message with a table built from the pool config. ls-pgs then printed
only a table header, or a table without stats, instead of the error.
Owner

Замержил без тестов, мелкие правки

Замержил без тестов, мелкие правки
vitalif closed this pull request 2026-10-25 22:23:24 +03:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#99
No description provided.