Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Implement the "noop" mode. #1106

wants to merge 5 commits into from

Conversation

iddm
Copy link
Collaborator

@iddm iddm commented May 15, 2024

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.

@iddm iddm requested a review from MeirShpilraien May 15, 2024 08:54
@iddm iddm self-assigned this May 15, 2024
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.
}
)]
fn function_call(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult {
RedisResult::Ok(RedisValue::Null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return some error message

}
)]
fn function_call_async(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult {
RedisResult::Ok(RedisValue::Null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message

}
)]
fn function_command_on_replica(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult {
RedisResult::Ok(RedisValue::Null)
Copy link
Collaborator

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

}
)]
fn function_command(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult {
RedisResult::Ok(RedisValue::Null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return an error message

Copy link
Collaborator

@MeirShpilraien MeirShpilraien left a 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.

}
)]
fn update_stream_last_read_id(_ctx: &Context, _args: Vec<RedisString>) -> RedisResult {
RedisResult::Ok(RedisValue::Null)
Copy link
Collaborator

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)
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants