1. François Van Lerberghe
  2. Valentina Server
  3. Tuesday, March 20 2018, 06:46 PM
  4.  Subscribe via email
Hello,

Yesterday, a customer of mine has his server computer completely frozen. He done a hard reset. But after opening the database again, the database was vastly corrupted and unusable. Is it possible that the corruption was due to the .journal rollback future, during the opening process ? I suspect so.

Last month another customer had a power outage. After opening the database again, the last 10 transactions (or so) were lost, despite the fact that I flush the database each time a task (transaction) is completed. Don't remember if the database was corrupted this time, sorry.

In order to avoid these problems. I plan to test the database before opening it, doing a database.CheckRollback.
If False,
1) backup the database
2) delete the .journal file
3) open the database

Could you give me an advice ? What is the right way ?

Thank you.

François
Comment
There are no comments made yet.
Ivan Smahin Accepted Answer
CheckRollback() must be called before db.Open() and returns true if journal exists and "valid" (it means the journal will be used to rollback db on db.Open()).
Backuping db files here could be helpful just for having "potentially damaged" db to analyze it later. But most probably db is really damaged and "restore from the journal" is the only way to get a healthy db back in most of cases.
Anyway, droping the journal file is bad idea, because you get a damaged db, no backup to restore and no journal to restore to the last "good state".

Journaling increases your chances for getting healthy db back, but you should have some db backups (on regular basis) anyway.

roducts:vserver:manual:using_backup" target="_blank" rel="nofollow">http://www.valentina-db.com/docs/dokuwiki/v8/doku.php?id=valentina:products:vserver:manual:using_backup

Are you sure that you really did db.Flush and nevertheless lost flushed transactions? Probably you flushed some tables only (not whole db) or another db?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 1
Indeed, delete the .journal file is a bad idea (at least if it's not the culprit).
Of course I have regular backup, but I try find a way to open the database minimizing the problems for the end-user when a crash had occurred.
I have double-checked my code and after each transactions, I do a whole database flush (I never do a single table flush as I think that doesn't flush really).

Before the journaling future, having a unexpected quit of the application, I used to delete the index file in order to rebuild it in the open process, to be sure to have an healthy index file. Now I do it too in this situation. Is it safe or the rollback process while opening the database do the indexes rebuild itself and in this case it's a bad idea to delete the index file ?
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 2
Ivan Smahin Accepted Answer
Yes, it is safe to drop index volume, but it is a redundant step since "db-restoring" will do reindex db itself.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 3
ok. Thank you.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Server
  3. # 4
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories