As we have "purge" enabled and one the nodes went offline, so now we have out of sync bin log.

I guess, I need to stop the slave, set the master to use the current bin log and start the slave and set the slave accordingly?

I understand bin "sync" is advisable. Is there anything else needed to setup for not ending up in this problem again?

Please advise. Thanks

  • What do you mean by "purge"? How long was the Replica offline? How many binlogs are built per day? (I am trying to determine whether the binlogs necessary have been purged, thereby necessitating a rebuild of the Replica.)
    – Rick James
    Sep 25, 2021 at 17:43
  • Yes, the necessary binlogs have been purged. The master was offline for a few days. Around 2-3 binlogs gets generated per day.
    – linuxarm
    Sep 25, 2021 at 17:51
  • For that reason, I like to have "expires" set to a week or two. Oh, wait... You say the Primary was offline? What is the setting of sync_binlog? And did it crash un-gracefully a few days ago?
    – Rick James
    Sep 25, 2021 at 17:58
  • Yes, mariadb was not running on the host, for a month or so although the host has been up longer than that. I'll have to check the logs to determine the cause and check the "sync_binlog" setting.
    – linuxarm
    Sep 25, 2021 at 18:04

1 Answer 1


A possible answer. Let me provide a scenario and its solution; I don't know if it applies to your situation:

  1. sync_binlog = 0.
  2. The Primary crashes.
  3. The Primary comes back online and starts a new binlog.
  4. The Replica grumbles.


  1. You find the new binlog.
  2. On the Replica set the position to the beginning of that new binlog. ("Beginning" is pos=0 or pos=4; either one works.)
  3. You go back to the Primary and turn on the sync_binlog so it won't happen again.

(If you are using GTIDs, I don't know the appropriate action.)

  • Thanks. I'm going to try those steps and will report back.
    – linuxarm
    Sep 25, 2021 at 20:57
  • It worked! Thanks much.
    – linuxarm
    Sep 28, 2021 at 1:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.