Skip to content

Fix refetch header data from delta when database in backup lock#8268

Merged
dyemanov merged 1 commit intoFirebirdSQL:masterfrom
red-soft-ru:master_fix_refetch_header_data_from_delta
Sep 30, 2024
Merged

Fix refetch header data from delta when database in backup lock#8268
dyemanov merged 1 commit intoFirebirdSQL:masterfrom
red-soft-ru:master_fix_refetch_header_data_from_delta

Conversation

@XaBbl4
Copy link
Copy Markdown
Contributor

@XaBbl4 XaBbl4 commented Sep 26, 2024

If for dbb_sweep_interval this is not so critical, then for dbb_repl_sequence this can damage the replica, since the segments will be saved with the old number (saved in the main header at the time of transition to the backup lock state) after each clean connection to the database.

Simple example for dbb_sweep_interval:

1 console - run isql
2 console - operations with gfix

1> create database 'test';
2> gfix -h 500 test
1> select mon$sweep_interval from mon$database; commit;
MON$SWEEP_INTERVAL
==================
               500
1> alter database begin backup;
2> gfix -h 1000 test
1> select mon$sweep_interval from mon$database; commit;    -- without reconnection to DB
MON$SWEEP_INTERVAL
==================
               1000             -- CORRECT
1> quit;
1> connect 'test';
1> select mon$sweep_interval from mon$database; commit;    -- after reconnection
MON$SWEEP_INTERVAL
==================
               500              -- WRONG (in delta file dbb_sweep_interval = 1000)

@livius2
Copy link
Copy Markdown

livius2 commented Sep 26, 2024

What about other flags?

@XaBbl4
Copy link
Copy Markdown
Contributor Author

XaBbl4 commented Sep 27, 2024

What about other flags?

As far as I can see, the other flags do not change after begin backup.
There are some doubts about the HDR_crypt_... flags, but they are also not read in PAG_init2, which requires refetch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment