0

We have a desktop application on Windows OS that installs with MariaDB server 10.4.10. Sometimes the client loses power and after restarting of PC MariaDB database becomes corrupted and Windows Server is not starting. The logs show that some tables are randomly broken. The server configuration is the default, not heavily loaded with one request per 1-5sec. I'm wondering if there are some configuration changes that can help avoid or at least decrease the probability of this issue?

2
  • 1
    Do you define all tables using the InnoDB storage engine? InnoDB has crash protection, other storage engines do not. For example, if some tables use MyISAM or Aria, they are susceptible to corruption when the OS crashes. This can happen even if the load is not heavy. Jun 11 at 21:00
  • @BillKarwin yes, all tables are InnoDB
    – WhoKnows
    Jun 12 at 8:01

1 Answer 1

1

Most likely it is because of Windows write caching. While caching provides speed, it also defers writing to disk. You dont normally want to remove it for everything.

One way to fix it,

  • create a new partition on your disk
  • move the database files onto it
  • disable write caching.

Note that there is the Flush command in MariaDB, that you could try.

3
  • Thanks. What is the case to use Flush command? If PC was rebooted after power was lost and data is broken on the disk no reason to use this command, right?
    – WhoKnows
    Jun 12 at 8:13
  • If you are frequently changing table structure upgrade to 10.6+ that has crash safety around table modifications.
    – danblack
    Jun 13 at 22:48
  • I doubt if any option to FLUSH is relevant.
    – Rick James
    Jun 16 at 3:09

Your Answer

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

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