0

I'm working in a clustered MariaDB database with Galera and MaxScale in r/w routing.
My question is if the commit command successful return implies a completed replication or not.

This is the scenario:

  1. I have a php application linked to MaxScale port.
  2. This application inserts a record
  3. Then it call using REST-API a local java application passing the new record id.
  4. The java application is connected to the same MaxScale port, and it read the inserted record

However sometimes it looks like Java cannot find the new record just inserted.

Is it possibile that the commit is returned even if the replication is not finished and then the java cannot find the record due to replication latency?

1 Answer 1

1

Yes, there is replication latency.

A successful commit implies there isn't a conflict. The other nodes of the cluster still need to apply the commit with applier threads which is the replication delay.

ref: https://galeracluster.com/library/documentation/certification-based-replication.html

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your answer, but is there any solution for my scenario? I it possible somehow to get the replication competition confirmation?
Use Master_wait_gtid as part of the second select where the gtid is returned from the first insert or there is probably a maxscale way in its configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.