-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
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
Implement the "noop" mode. #1106
Conversation
Adds a "noop" mode where the module acts like it is a fully-operational RedisGears v2 (triggers and functions) module, while in fact does nothing. It still loads the RDB, has the same commands, but the commands do not perform any action, though still can be invoked. The configuration options remain as well.
Adds the integration tests to check that the RDB file is read but nothing is taken from it.
redisgears_core/src/noop/mod.rs
Outdated
} | ||
)] | ||
fn function_call(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult { | ||
RedisResult::Ok(RedisValue::Null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return some error message
redisgears_core/src/noop/mod.rs
Outdated
} | ||
)] | ||
fn function_call_async(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult { | ||
RedisResult::Ok(RedisValue::Null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error message
redisgears_core/src/noop/mod.rs
Outdated
} | ||
)] | ||
fn function_command_on_replica(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult { | ||
RedisResult::Ok(RedisValue::Null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an internal command between to replica and AOF, it should return a simple OK reply
redisgears_core/src/noop/mod.rs
Outdated
} | ||
)] | ||
fn function_command(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult { | ||
RedisResult::Ok(RedisValue::Null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return an error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I believe that we also need to remove the dependency on the ramp.yml so that only the noop module will be added to the final zip.
redisgears_core/src/noop/mod.rs
Outdated
} | ||
)] | ||
fn update_stream_last_read_id(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult { | ||
RedisResult::Ok(RedisValue::Null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an internal command between to replica and AOF, it should return a simple OK reply
|
||
# Stream triggers | ||
env.cmd('xadd', 'stream1', '*', 'foo', 'bar') | ||
env.assertEqual(env.cmd('get', 'triggers_counter'), None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also check AOF Loading with _rg_internals.*
commands
Adds a "noop" mode where the module acts like it is a fully-operational RedisGears v2 (triggers and functions) module, while in fact does nothing. It still loads the RDB, has the same commands, but the commands do not perform any action, though still can be invoked. The configuration options remain as well.