Feature: add \shards command to track relocations#494
Feature: add \shards command to track relocations#494mannreis wants to merge 14 commits intocrate:mainfrom
Conversation
- empty views when db empty or no shards relocating
seut
left a comment
There was a problem hiding this comment.
I've added some suggestions related to the used statements, otherwise looks fine.
I had a bit in mind that having some ongoing progress visible with some kind of progress bar, which one could get out e.g. by ctrl-c would be awesome, but also probably better to work on this as a followup, now that you've done the ground work :)
About real integration testing: Right, this would require at least 2 nodes to make it work. Utilizing the testcontainers to make this work would be really great, but agree, lets look into this as followup as well.
|
@mannreis any update on this, do you need any further help to continue? |
|
Your suggestions were already a great help! I'll apply them early next week. They seem easy enough to have been applied already. Regarding your original idea of an interactive progress bar. I saw that postgres cli had a |
Adds columns `schema_name` and `partition_ident` to the query and improves it by replacing `CASE WHEN` with `FILTER(WHERE ... )` Co-authored-by: Sebastian Utz <su@rtme.net>
Add `primary` column to the shards query Co-authored-by: Sebastian Utz <su@rtme.net>
- table shards view available via "\shards info"
Summary of the changes / Why this is an improvement
As requested in #493 this PR aims adds a new command
\shardsto conveniently query for shards undergoing relocation. It computes the the aggregated progress per table based on the sum of the sizes of relocating shards divided by the total size of the table shards.Optionally,
stateandrelocatingcan be provided as an argument to respectively:Integration testing
I resorted to
docker composeand scripting to move shards withing a cluster in order to test the what's implemented here. In order integrate that type of testing it in this code base, I spent sometime looking atcratedb_toolkit.testing.testcontainers.cratedbbut I believe it would require another PR. For now, I resort to single-node integration testing.Checklist
CHANGES.txt