We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis SORT command returns an error on slave instances and orderBy() always returns empty result.
SORT
orderBy()
To reproduce the problem make Redis master and slave, make and add any ActiveRecord model. Do query with orderBy() on slave instance:
ActiveRecord
$model = Model::find()->orderBy(['id' => \SORT_DESC])->one();
null will be return. Lua script that will be executed:
null
Lua
local allpks=redis.pcall('SORT', 'model', 'BY', 'model' .. ':a:*->' .. 'id', 'DESC') if allpks['err'] then allpks=redis.pcall('SORT', 'model', 'BY', 'model' .. ':a:*->' .. 'id', 'DESC', 'ALPHA') end local pks={} -- inside doesn't matter return pks -- {} this is will be return
allpks will be contain an error:
allpks
(error) @user_script: 3: -READONLY You can't write against a read only replica.
And empty pks will be return.
pks
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Redis
SORT
command returns an error on slave instances andorderBy()
always returns empty result.To reproduce the problem make Redis master and slave, make and add any
ActiveRecord
model. Do query withorderBy()
on slave instance:null
will be return.Lua
script that will be executed:allpks
will be contain an error:And empty
pks
will be return.Additional info
The text was updated successfully, but these errors were encountered: