Warm up ranges before production deployment

replication

(James Hartig) #1

What’s the recommended way of warming up ranges so that the leaseholder is in the right zone/region? Our issue is that we have data across 2 continents and 3 regions per continent in an existing database that’s doing over 100k operations a minute. We can’t just flip the switch to start storing in CockroachDB because it would only hit the single leaseholder until the ranges count grew enough for there to be enough ranges to be spread evenly.

Right now we’re just planning on inserting fake data (but real enough to match the primary key ranges that we expect in production) in each region until we have enough ranges and then in a few weeks, deleting the fake data.


(Marc) #2

Hello James,

You can use the ALTER TABLE ... SPLIT AT ... statement to create an arbitrary number of splits in a table. The statement doc page has details on splitting on different types of keys.


(James Hartig) #3

Ah great! That’s super helpful. We can at least pre-configure the splits and then after a small ramp up period the leaseholders should hopefully be in the right regions.


(Marc) #4

The splits will take care of creating new ranges (as opposed to having to wait for natural splits), but it will not necessarily distribute the lease holders in an optimal way for soon-to-be traffic. I’m not sure there’s a good answer for that part other than running actual load.