-
Notifications
You must be signed in to change notification settings - Fork 183
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
fix for reassign Table Keys faust-streaming#171 #174
Conversation
faust/stores/memory.py
Outdated
@@ -31,7 +31,9 @@ def apply_changelog_batch( | |||
self._create_batch_iterator(to_delete.add, to_key, to_value, batch) | |||
) | |||
for key in to_delete: | |||
delete_key(key, None) | |||
# If the key was assigned a value again at a later time, it will not be deleted. |
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.
Could you add a quick unit test to test this?
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 have added a test for this case. Until now there was no test for this use case.
@@ -31,7 +31,9 @@ def apply_changelog_batch( | |||
self._create_batch_iterator(to_delete.add, to_key, to_value, batch) | |||
) | |||
for key in to_delete: | |||
delete_key(key, None) | |||
# If the key was assigned a value again at a later time, it will not be deleted. | |||
if not self.data[key]: |
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.
Is this an issue only for memory store? Rocksdb store does not have this issue AFAIK
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.
The issue is only for memory. When I look into the code for Rocksdb I don't recongnize that there can be the same error
Description
(Fixes #171)
When a key is removed from a table with table.pop(), a changelog entry is sent with a raw null value.
Before this change, on Table recovery, once a key was set to the raw null value, it would be deleted after iterating over the entire Changelog topic.
Now, before deletion, the value for this key is checked to see if it is really null. Otherwise it was assigned to a new value at a later time and will not be deleted