YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

Source server should clear backlog and not terminate with FILEDELFAIL or RENAMEFAIL errors #282

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

Final Release Note

Description

A journal file switch operation involves the following steps.

  1. mumps.mjl is current generation journal file
  2. When mumps.mjl becomes full, the first step is to create mumps.mjl_%YGTM
  3. Fill mumps.mjl_%YGTM journal file header with valid data
  4. Rename mumps.mjl to mumps.mjl_ (e.g. mumps.mjl_2018144122944)
  5. Rename mumps.mjl_%YGTM to mumps.mjl

If a process doing updates to the journal file encounters an error during Step 4 or Step 5 (for example due to no write permissions in the directory containing the mumps.mjl file) and the database has "Inst Freeze on Error" set to TRUE, a JNLEXTEND/JNLNOCREATE error is issued by the process and the instance is frozen. In this situation, if a source server connects to a receiver server and reads from journal files (for example if it was started with the -jnlfileonly qualifier), it terminates with a FILEDELFAIL or RENAMEFAIL error (depending on error in Step 4 or Step 5 respectively). This is unfriendly. Instead it can avoid trying to do the rename and just open the existing journal files and read from them in order to clear the backlog (if any) and then hang waiting for the instance freeze to clear.

Draft Release Note

The source server better handles situations where the instance froze due to errors in journal file switching (for example, directory holding journal files had write permissions removed) by clearing the backlog as much as possible and then waiting for the instance freeze to clear. In previous versions, it could terminate with a FILEDELFAIL or RENAMEFAIL error in such scenarios.