-
Notifications
You must be signed in to change notification settings - Fork 337
MOD-7293 fix AOF commands duplicated in JSON.MSET #1212
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
Conversation
eranhd
commented
Jun 24, 2024
- Write to AOF outside the iterator
- Added notify_keyspace_event API to manager
2. Added notify_keyspace_event API to manager
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.
👍
Few suggestions
}; | ||
if updated { | ||
redis_key.apply_changes(ctx, "json.mset")? | ||
redis_key.notify_keyspace_event(ctx, "json.mset")? |
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 think the separation you are doing here is right, manager should probably not handle the replication. But I believe we should make this separation all over the code, WDYT?
In addition, maybe we should find a more general name to it? Because on HDT it also need to apply the changes on the key and fire the effects.
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.
how it's managed in redis? there are calling to replication and notify in the commands? or it's something that happened in the behind the scenes?
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.
Notify is per command.
Replication is a totally different mechanism.
} | ||
} | ||
|
||
fn notify_keyspace_event(&mut self, ctx: &Context, command: &str) -> Result<(), RedisError> { |
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.
If we're splitting the functionality of apply_changes
then we should have it call notify_keyspace_event
to reduce duplication. eg something like
fn apply_changes(&mut self, ctx: &Context, command: &str) -> Result<(), RedisError> {
self
.notify_keyspace_event(ctx, command)
.inspect(|_| ctx.replicate_verbatim())
}
the apply change API call only to notify
Let make sure to do the relevant changes on HDT as well. |
… to seperate the replication from notify
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1212 +/- ##
==========================================
+ Coverage 77.59% 78.00% +0.40%
==========================================
Files 14 14
Lines 3923 3996 +73
==========================================
+ Hits 3044 3117 +73
Misses 879 879 ☔ View full report in Codecov by Sentry. |
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.
👍
…_in_mset MOD-7293 fix AOF commands duplicated in JSON.MSET (cherry picked from commit 5ae9ad3)
* Merge pull request #1211 from RedisJSON/ephraim_update-base-rdbs-url - update s3 bucket url - fix coverage test failure - fix asan build failure (cherry picked from commit b7e1f35) * MOD-7293 Merge pull request #1212 from RedisJSON/eranhd_aof_duplicate_in_mset MOD-7293 fix AOF commands duplicated in JSON.MSET (cherry picked from commit 5ae9ad3) (cherry picked from commit a290d1b) * MOD-7342 fix centos7&amzn2 build (#1214) (cherry picked from commit 0a1de82) (cherry picked from commit dd3c33c)
…_in_mset MOD-7293 fix AOF commands duplicated in JSON.MSET (cherry picked from commit 5ae9ad3)