docs icon indicating copy to clipboard operation
docs copied to clipboard

ALTER TABLE table_name SCATTER is not documented

Open keith-mcclellan opened this issue 6 years ago • 8 comments

Keith McClellan commented:

https://www.cockroachlabs.com/docs/v19.1/alter-table.html doesn't cover SCATTER, which tells the database to redistribute the leaseholders. This is useful when troubleshooting hot ranges and to speed recovery after an outage.

Jira Issue: DOC-286

keith-mcclellan avatar Jun 25 '19 18:06 keith-mcclellan

This came up on a call with Tenable - we used it to troubleshoot a node that appeared to be slow.

keith-mcclellan avatar Jun 25 '19 18:06 keith-mcclellan

Passing this to you, @ericharmeling, very late.

jseldess avatar Nov 22 '20 22:11 jseldess

This came up recently on the KV team, where we found that very few people even on engineering understand exactly what SCATTER does.

When we document this, we should mention that SCATTER has the potential to result in data movement proportional in size to the size of the table being scattered. So it can take some time.

nvb avatar Jan 06 '21 16:01 nvb

Nick Vigilante (nickvigilante) commented: KV team wants to put this on hold since they’re significantly changing the behavior of {{SCATTER}}.

exalate-issue-sync[bot] avatar Jan 27 '22 20:01 exalate-issue-sync[bot]

Michael Wang (mwang1026) commented: When we document this, we want to make sure there’s a big warning that this could be a very disruptive operation, since it could cause a lot of rebalancing ranges across nodes which would lead to high network usage, high CPU and high disk utilization. (as in, it doesn’t just rebalance leaseholders it could rebalance replicas as well)

The original use of this feature was the scatter pre-split ranges in IMPORT and other backfill-y type features where we know a lot of volume is coming.

exalate-issue-sync[bot] avatar Feb 15 '22 21:02 exalate-issue-sync[bot]

Michael Wang (mwang1026) commented: Here’s the PR https://github.com/cockroachdb/cockroach/pull/75894

exalate-issue-sync[bot] avatar Feb 15 '22 21:02 exalate-issue-sync[bot]

Richard Loveland (rmloveland) commented: Hey Nick Vigilante - Michael Wang says the new behavior just merged (I think it’s this PR). I noticed you have a PR in progress - let me know if you still want this or if you would like me to do it since it’s also KVish

exalate-issue-sync[bot] avatar Feb 15 '22 21:02 exalate-issue-sync[bot]

Nick Vigilante (nickvigilante) commented: Richard Loveland Would you be able to take this one? I’m putting my focus on releases for the next 2-3 weeks.

exalate-issue-sync[bot] avatar Feb 15 '22 21:02 exalate-issue-sync[bot]