feat(cluster): check command keys ownership (#1194)

* feat(cluster): check command keys ownership on cluster mode

Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
adiholden 2023-05-10 12:06:52 +03:00 committed by GitHub
parent 36cd15a196
commit 577472eb22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 205 additions and 16 deletions

View file

@ -118,6 +118,10 @@ class Service : public facade::ServiceInterface {
// Return false if command is invalid and reply with error.
bool VerifyCommand(const CommandId* cid, CmdArgList args, ConnectionContext* cntx);
// Return false if not all keys are owned by the server when running in cluster mode.
// If false is returned error was sent to the client.
bool CheckKeysOwnership(const CommandId* cid, CmdArgList args, ConnectionContext* dfly_cntx);
const CommandId* FindCmd(CmdArgList args) const;
void EvalInternal(const EvalArgs& eval_args, Interpreter* interpreter, ConnectionContext* cntx);