Inconsistent update behavior with R2DBC and PostgreSQL: returns Successfully updated campaign 0197bf4a-1ab7-72b3-92ef-ebe128bdb15e rows affected 0: MDC: {} #1930
Replies: 1 comment 2 replies
-
Closing as a duplicate apache/pekko-persistence-r2dbc#224 You don't need to cross post to multiple Pekko projects. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
We're encountering an issue where a reactive flow using R2DBC + PostgreSQL intermittently fails to find a record that was just inserted. Specifically, update is success but returns update query affects 0 rows, even though the insert has already occurred.
Flow of app
Campaign is created from UI ---> Event is persisted for MessageCreated and count is updated for created ---> Then app waits for response from Message service Provider that message is sent and when we confirm itthen we sent event for messageSent ---> then we update sent count
There is no issue on local (one JVM environment) count is updating fine but on prod there are 3 node and count is not updating.
And this does not occur every times some times it updates count for coming event just right but sometime it cause issue
This happens in a low-load environment (only 1 message), with no replicas, and appears to be a visibility or subscription timing issue in the reactive chain.
I am beginner to Apache Pekko and R2DBC so please guide me what can be the issue here.
Environment
Observed Behavior
findById(campaignId)
returnsOptional.empty
.UPDATE campaigns SET ... WHERE id = $2
affects 0 rows.Relevant log:
Beta Was this translation helpful? Give feedback.
All reactions