Issue Details (XML | Word | Printable)

Key: CORE-6323
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Dmitry Yemanov
Votes: 0
Watchers: 2

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

File-system ID may be duplicated among databases located on different volumes

Created: 03/Jun/20 04:47 PM   Updated: 06/Jun/20 09:32 AM
Component/s: Engine
Affects Version/s: 2.5.0, 2.5.1, 2.5.2, 2.5.2 Update 1, 2.5.3, 2.1.7, 2.5.3 Update 1, 2.5.4, 2.5.5, 4.0 Initial, 3.0.0, 2.5.6, 3.0.1, 2.5.7, 3.0.2, 4.0 Alpha 1, 2.5.8, 3.0.3, 3.0.4, 4.0 Beta 1, 2.5.9, 3.0.5, 4.0 Beta 2
Fix Version/s: 3.0.6, 4.0 RC 1

Environment: Windows only

QA Status: Cannot be tested

 Description  « Hide
Firebird uses file-system ID of the open database file to uniquely name its dependent shared memory files - lock table, event table, etc. File-system ID is retrieved using GetFileInformationByHandle() API and composed from the three fields (dwVolumeSerialNumber, nFileIndexHigh, nFileIndexLow) that are documented in MSDN as providing a unique combination:

"You can compare the VolumeSerialNumber and FileIndex members returned in the BY_HANDLE_FILE_INFORMATION structure to determine if two paths map to the same target; for example, you can compare two file paths and determine if they map to the same directory."

The problem, however, is that Volume Serial Number (VSN) is not guaranteed to be unique. It's generated when then the volume is formatted and it's stored inside the volume's master boot record. But if the volume is cloned at the physical block level, or if a virtual (preformatted) drive is used, or if a volume snapshot (created by storage system like Dell EMC) is attached as a different logical drive, then VSN may duplicate an existing VSN. This may cause two different databases (located on different volumes) to share the same file-system ID thus sharing the same lock table, causing unexpected freezes and other undesired side-effects.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.