1

This is a question about MariaDB (mostly) and a replication that I am considering.

For this replication, the Primary database is updated every minute by a process which can take about 15 seconds to complete, each time. During these 15 seconds, the Primary database may not be completely consistent on each tables.

I want to set a Replica for this database on another server. On the Replica server, I expect to do some periodic post-processing on this database, which needs (preferably) the database to be in a consistent state (and maybe writing the results back to the Primary server, see this question).

Is there a way to know when the Replica has fully replicated this consistent state, or to force it to stay in this state, in order I can do the post-processing without errors?

(On the multiple servers I have, MariaDB versions can be 10.3.38 or 10.5.19 or 10.6.12. Servers are Linux Debian 10, Linux Debian 11 or Linux Ubuntu 22.04.3 LTS).

GingkoFr
  • 83
  • 5
  • `Seconds_behind_master` is not definitive, but it is probably the best available. What the heck takes 15 minutes? Can that be sped up? – Rick James Aug 06 '23 at 15:03
  • I said 15 seconds, not 15 minutes. – GingkoFr Aug 06 '23 at 15:15
  • 1
    Inject (into an extra table) some indication that the periodic update is finished. – Rick James Aug 06 '23 at 15:42
  • SQL Transactions are there to keep the database consistent whenever you need to do complex data modifications. – AlexD Aug 06 '23 at 15:42
  • This extra table would also need to be part of the replication. Can I be sure it will be replicated in strict order? And about SQL Transactions … replicating them will certainly, nevertheless, need some time. Can I be sure that they will be atomic in the Replica? – GingkoFr Aug 06 '23 at 16:02
  • 1
    @GingkoFr - The general answer to those questions is " all will work correctly". However, since there are ways to bypass things, we would need to seep specifics to confirm it. – Rick James Aug 06 '23 at 22:37

0 Answers0