Skip to content

Commit

Permalink
[yugabyte#9430] docdb: Added success message for all tablets and sing…
Browse files Browse the repository at this point in the history
…le tablet compaction/flushes

Summary:
There was no notification for completion of all tablets compaction previously.
This PR adds print statements following the completion of compaction + flushes for single tablet and all tablets.

Test Plan:
- Jenkins
- When using `yb-ts-cli` for compactions/flushes, there should now be a success message:
```
>>> bin/yb-ts-cli --server_address=127.0.0.1:9100 compact_all_tablets
Successfully compacted all tablets
>>> bin/yb-ts-cli --server_address=127.0.0.1:9100 flush_all_tablets
Successfully flushed all tablets
>>> bin/yb-ts-cli --server_address=127.0.0.1:9100 flush_tablet 6ad60a8aa2d44e3aa4de8ad6976c6cd0
Successfully flushed tablet <6ad60a8aa2d44e3aa4de8ad6976c6cd0>
>>> bin/yb-ts-cli --server_address=127.0.0.1:9100 compact_tablet 6ad60a8aa2d44e3aa4de8ad6976c6cd0
Successfully compacted tablet <6ad60a8aa2d44e3aa4de8ad6976c6cd0>
```
Verify that failure messages still work:
```
>>> bin/yb-ts-cli --server_address=127.0.0.1:9100 compact_tablet invalid-tablet-id
Unable to compact tablet: IO error (yb/tools/ts-cli.cc:470): Failed to flush tablet: : code: TABLET_NOT_FOUND status { code: NOT_FOUND message: "Tablet not found: invalid-tablet-id" source_file: "../../src/yb/tserver/ts_tablet_manager.cc" source_line: 1637 errors: "\000" }
```

Reviewed By: jhe

Differential Revision: https://phabricator.dev.yugabyte.com/D12398
  • Loading branch information
leeleeian authored Jul 27, 2021
1 parent e32e1e4 commit 726d344
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,4 @@ This is a list of people who have contributed code to the [YugabyteDB](https://g
* [jackstenglein](https://github.com/jackstenglein)
* [BozhiYou](https://github.com/bozhiyou)
* [pkj415](https://github.com/pkj415)
* [leeleeian](https://github.com/leeleeian)
3 changes: 3 additions & 0 deletions src/yb/tools/ts-cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ Status TsAdminClient::FlushTablets(const std::string& tablet_id, bool is_compact
return STATUS(IOError, "Failed to flush tablet: ",
resp.error().ShortDebugString());
}
std::cout << "Successfully " << (is_compaction ? "compacted " : "flushed ")
<< (tablet_id.empty() ? "all tablets" : "tablet <" + tablet_id + ">")
<< std::endl;
return Status::OK();
}

Expand Down

0 comments on commit 726d344

Please sign in to comment.