cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.92k stars 3.78k forks source link

storage: DRY {client_,}range_tree_test.go #7495

Closed tamird closed 8 years ago

tamird commented 8 years ago

Requested in #5839: these two files mostly test the same things at different levels - it'd be good to abstract over the backing storage and have a single test runner that exercises both.

Seems like a good starter task.

petermattis commented 8 years ago

Or we could remove the range tree code.

tamird commented 8 years ago

Yep, that's also an option, though we've had trouble reaching consensus on that in the past.

petermattis commented 8 years ago

The distsql folks should weigh in. @RaduBerinde @andreimatei do you have any intention to use the range tree code?

RaduBerinde commented 8 years ago

None that I know of - nothing I can think of that can't be done just as well from the meta range structures.

BramGruneir commented 8 years ago

I'll be unhappy if it's gone, but I'll kill it if there's no need for it.

petermattis commented 8 years ago

FYI, here was the previous issue discussing this: https://github.com/cockroachdb/cockroach/issues/3739

tbg commented 8 years ago

We have this discussion every couple of months. My reasoning for keeping them around was "they don't hurt", but having this discussion and random refactoring every now and then does hurt. I'm ok with removing the code. We're very unlikely to use it for a while and once we do, chances are it can be brought back easily.

On Mon, Jun 27, 2016 at 5:22 PM Peter Mattis notifications@github.com wrote:

FYI, here was the previous issue discussing this: #3739 https://github.com/cockroachdb/cockroach/issues/3739

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cockroachdb/cockroach/issues/7495#issuecomment-228879594, or mute the thread https://github.com/notifications/unsubscribe/AE135MQyYlK3HvGO5ZWERPcYkFlBLR6eks5qQD8dgaJpZM4I_gEC .

-- Tobias

andreimatei commented 8 years ago

The range tree is used by this lookupReplica guy, right? https://github.com/cockroachdb/cockroach/blob/553c0e82341c99bf0a3dc782f64dfbf213e72700/storage/stores.go#L198 That function is pretty useful in tests (for example through the Stores.Send() which uses it to fill in missing routing info). Would we replace this somehow?

tamird commented 8 years ago

This is about storage/range_tree.go, which is not used anywhere (except (*Replica).AdminSplit, which maintains the range tree itself).

petermattis commented 8 years ago

The range tree code will be a year old come August without any usage.

BramGruneir commented 8 years ago

The only complication with removing it, is we would need a data migration to remove it.

petermattis commented 8 years ago

@BramGruneir Why would you need a data migration? We can leave the old structures in place and stop updating them.

BramGruneir commented 8 years ago

Yeah, we just had that discussion. It would be a badge of honour if your cluster still had some of the range tree in it.

a6802739 commented 8 years ago

so we can remove range_tree.go and range_test.go. In function adminsplit and adminmerge we should also remove the operate with rangetree, right?

petermattis commented 8 years ago

@a6802739 Yes, you would remove the maintenance of the range tree from splits and merges.