-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GH-8732 Don't remove JDBC message if other groups #8733
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
Fixes spring-projects#8732 When same message is added into different groups, its record in the `INT_MESSAGE` must remain until the last group is removed * Improve `JdbcMessageStore.DELETE_MESSAGES_FROM_GROUP` SQL to ignore those messages for removal which has other group records in the `INT_GROUP_TO_MESSAGE` table **Cherry-pick to `6.1.x`, `6.0.x` & `5.5.x`**
to remove from `INT_MESSAGE` only if there is no other records in `INT_GROUP_TO_MESSAGE`
I think we'll need some javadocs on Therefore, it will need to override the parent javadoc... * Remove the Message with the given id from the MessageStore, if present, and return it. If no Message with that id
* is present in the store, this will return <i>null</i>. ...to indicate that it will not be removed if the message is present in one or more groups. |
Or, update the parent javadocs to mention that if the implementation is on a |
Also, is this just a JDBC problem or can it happen with any MGS? |
I thought about that, but let's see if we are correct about the fix for JDBC only and let's really decide how deep we would like to back-port it! I believer we have a couple workarounds:
|
mentioning `MessageGroupStore` specifics
Yes, I don't think it was anticipated that the same MGS would be used for different aggregators, and certainly not if those aggregators each get the same message ids. However, I can see that with large groups (and/or messages), this would be a benefit, avoiding duplication. |
Perhaps a different issue, but we should consider optimizing Currently, we detect (and ignore) duplicates after conversion and attempting to update. We might want to check if it already exists first. |
So, I'm OK to have this as a fix only on However I still in doubts in a query for Other stores might be fixed in other PR to not make this too complicate. The |
? Do you want it merged, or not? |
Sure! Let's merge it! |
* GH-8732 Don't remove JDBC message if other groups Fixes #8732 When same message is added into different groups, its record in the `INT_MESSAGE` must remain until the last group is removed * Improve `JdbcMessageStore.DELETE_MESSAGES_FROM_GROUP` SQL to ignore those messages for removal which has other group records in the `INT_GROUP_TO_MESSAGE` table **Cherry-pick to `6.1.x`, `6.0.x` & `5.5.x`** * * Fix `JdbcMessageStore.removeMessage()` and `removeMessagesFromGroup()` to remove from `INT_MESSAGE` only if there is no other records in `INT_GROUP_TO_MESSAGE` * * Improve `MessageStore.removeMessage()` Javadoc mentioning `MessageGroupStore` specifics
...and cherry-picked as ccaa853 |
@garyrussell , |
Doesn't look like |
Looks like an |
Fixes #8732
When same message is added into different groups,
its record in the
INT_MESSAGE
must remain until the last group is removedJdbcMessageStore.DELETE_MESSAGES_FROM_GROUP
SQL to ignore those messages for removal which has other group records in theINT_GROUP_TO_MESSAGE
tableCherry-pick to
6.1.x
,6.0.x
&5.5.x