Issue Details (XML | Word | Printable)

Key: CORE-3466
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Vlad Khorsun
Reporter: Vlad Khorsun
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

Some changes could be lost during the merge of delta file into main database file

Created: 05/May/11 06:08 PM   Updated: 15/Jul/15 04:26 AM
Component/s: Engine
Affects Version/s: 2.5.0
Fix Version/s: 2.5.1, 3.0 Alpha 1

Environment: SuperServer

QA Status: Cannot be tested

 Description  « Hide
When merge is in progress engine writes changes into both delta and main file. This creates additional IO load of course.
Therefore in v2.5 merge process was optimized - when page is read from delta file for merging purposes it is marked (with
BDB_merge flag) and not writed back into delta. It is OK if page not leave the cache until merge done. But there is a scenario
when this optimization is wrong :
a) page is read by merge process and marked by BDB_merge flag
b) page is changed by some user attachment and written into database file only
c) page is evicted from the page cache
d) user attachment going to change that page again
e) page is read from delta, this copy have no changes by (b) !
f) page is changed and written into both database and delta, overwriting changes by (b) in database

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 05/May/11 06:19 PM - edited
Classic is not affected as there is no other activity except of merge itself in the same page cache instance. I.e. there is no user process which could
change page marked with BDB_merge flag. Note, this optimization not applicable for Classic.

Solution is to undo such optimization. Another way to avoid double writes could be implemented but not in this ticket.