Skip to content

Don't raise CrossSlotError when no keys given

Sean McGivern requested to merge fix-crosssloterror-with-no-keys into master

What does this MR do?

When no keys are passed to a Redis command that accepts multiple keys, that's an error. But it's not a cross-slot violation, as there are no slots. By raising this error we were masking the true Redis::CommandError underneath, which is bad for two reasons:

  1. It's confusing to developers.
  2. It leads to a different failure in production to development and test.

To elaborate a bit more on the second point: the purpose of the CrossSlotError is to only be an additional error in development and test, but it shouldn't replace underlying errors as that can cause
issues like this one.

See #297349 (closed) for a case where this was a problem.

Merge request reports

Loading