octopus icon indicating copy to clipboard operation
octopus copied to clipboard

Comparison In Octopus Inspects Current Shard

Open spencerneste opened this issue 7 years ago • 2 comments

What is the purpose of inspecting the current_shard when comparing two objects? https://github.com/thiagopradi/octopus/blob/master/lib/octopus/model.rb#L34

We are using Octopus and are getting failed comparison for the same objects. For example

Foo.where(id: 1) | Foo.using(:slave).where(id: 1)

will return an array containing the same record twice. What is the reasoning behind wanting to know which shard the query was run on and why does that influence comparison? If this is a feature it would be great if it were opt in or opt out, but if there isn't a reason then I am happy to make a PR and remove it, since it is preventing us from using Octopus at full capacity.

spencerneste avatar Jul 28 '17 18:07 spencerneste

+1

jughead avatar Sep 21 '17 11:09 jughead

Hi @spencerneste / @jughead ,

Yes, this is a feature - it is actually useful for a few use cases. but, I agree, we should have a configuration to opt-in or out of it.

Can you provide a PR adding a configuration key for it? We might even disable it by default.

Thiago

thiagopradi avatar Nov 04 '17 17:11 thiagopradi