cubrid icon indicating copy to clipboard operation
cubrid copied to clipboard

[CBRD-24378] Fix the restoredb not to go beyond the given time (-d)

Open wrlawodms opened this issue 3 years ago • 2 comments

http://jira.cubrid.org/browse/CBRD-24378

Purpose To prevent the restoredb from doing recovery beyond the given time with the -d option.

Implementation

  • A new log record for the sysop commit is added. It includes the donetime like the LOG_COMMIT. This time information is used for the time-specific restore.
  • For the backward compatibility, the old log record type still remains.
  • The new log record type use the name of the old log record type name: LOG_COMMIT_WITH_POSTPONE.
  • The name of the old record type is changed to LOG_COMMIT_WITH_POSTPONE_OBSOLETE.
  • The macro number which the new log record type use was for LOG_WILL_COMMIT, which had been obsolete for a long. I believe no one has a log including this type.

wrlawodms avatar Jun 14 '22 08:06 wrlawodms

Another scenario to consider: LOG_COMMIT_WITH_POSTPONE LOG_RUN_POSTPONE (the page affected by this log is flushed) //backuptime //stopat LOG_COMMIT (this transaction is on-going during the online backup)

If a page affected by a LOG_RUN_POSTPONE log record is flushed already, there seems no way to undo it. I didn't handle this case because the restoration process starts from the data volume in the backup volume so that the case doesn't happen. However, considering the online backup, it could happen, though unlikely.

wrlawodms avatar Jun 21 '22 09:06 wrlawodms

I have changed to another approach: a new log record type for the sysop commit with a donetime. Please see the PR description.

wrlawodms avatar Aug 12 '22 02:08 wrlawodms