-
Notifications
You must be signed in to change notification settings - Fork 76
Fix key deserialization propagation in windows #848
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
base: main
Are you sure you want to change the base?
Conversation
dd3bf22
to
62d6b4e
Compare
When retrieving a prefix during partition-level windows expiration, we | ||
don't know its original type due to this conditional serialization. | ||
Therefore, we must first *try* to deserialize it using the configured | ||
`loads` function. |
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 we store an indicator about the prefix type, if it's a byte or something else ?
For migration, existing windows missing that information can try to deserialize
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.
Yes, but it's considerably more code, not sure if it's worth it.
Let's see what @daniil-quix thinks. But even if we decide to do this, it may be done as a separate optimisation; in the meantime, this will fix the bug.
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'm mostly worried about the performance hit of trying to deserialise every keys
Despite
key_deserializer
being set tojson
, after windowing, the deserialization is gone, and the key is served back as bytes. Affected windows:Tumbling and hopping windows with the closing strategy "key" are unaffected.
process_window
instead of the serialized one coming from the store.state.expire_windows
, so it doesn't need to return it._deserialize_prefix
for a detailed explanation.