Skip to content

Fix cases where the precedence relationship between a record page and a blob page is not set#7737

Merged
ilya071294 merged 1 commit intoFirebirdSQL:masterfrom
red-soft-ru:5_0_blob_precedence_fixes
Sep 6, 2023
Merged

Fix cases where the precedence relationship between a record page and a blob page is not set#7737
ilya071294 merged 1 commit intoFirebirdSQL:masterfrom
red-soft-ru:5_0_blob_precedence_fixes

Conversation

@ilya071294
Copy link
Copy Markdown
Contributor

@ilya071294 ilya071294 commented Sep 5, 2023

The precedence is not set when:

  1. A blob is deleted during the intermediate garbage collection (FB4+).
  2. A blob is created for a modified record.

Both cases can lead to a situation where a record points to a blob that doesn't exist or that belongs to another record, which is quite dangerous.

… a blob page is not set

1. While performing the intermediate garbage collection.
2. While modifying a blob field of a record.
@ilya071294 ilya071294 merged commit 4560aad into FirebirdSQL:master Sep 6, 2023
@ilya071294 ilya071294 deleted the 5_0_blob_precedence_fixes branch September 6, 2023 13:21
ilya071294 added a commit that referenced this pull request Sep 7, 2023
… record page and a blob page is not set

1. While performing the intermediate garbage collection.
2. While modifying a blob field of a record.
ilya071294 added a commit that referenced this pull request Sep 7, 2023
…a record page and a blob page is not set while modifying a blob field of a record
@ilya071294 ilya071294 self-assigned this Sep 7, 2023
@pavel-zotov
Copy link
Copy Markdown

The precedence is not set when:
...
2. A blob is created for a modified record.

Can it be reproduced in ISQL ? Is it reproducible when work in the single attachment ?
Perhaps, I did not understand properly doing following:

C:\FB\50sc>C:\FB\50sc\isql /:employee -z
ISQL Version: WI-T5.0.0.1182 Firebird 5.0 Beta 2
Server version:
WI-T5.0.0.1182 Firebird 5.0 Beta 2
WI-T5.0.0.1182 Firebird 5.0 Beta 2/tcp (Image-PC1)/P18:C
WI-T5.0.0.1182 Firebird 5.0 Beta 2/tcp (Image-PC1)/P18:C
Database: /:employee, User: SYSDBA
SQL> recreate table test(id int primary key, x int, b blob);
SQL> insert into test(id,x) values(1, 100);
SQL> commit;
SQL> update test set x = -x;
SQL> update test set b = (select list(uuid_to_char(gen_uuid())) from rdb$types rows 3);
SQL> commit;
SQL> set blob all;
SQL> set list on;
SQL> select * from test;

ID                              1
X                               -100
B                               8b:1e0
88DBFFFC-A5DC-422A-B1AB-1BEFD27A7529,7A67BB30-ECF2-4E8E-99CF-F6C7158F6B80,03C444C2-211A
-66242F88D5D1,98EADB17-F94D-4401-A587-57AC4467AC49,C77C21FE-6D45-498E-9167-22532239CAEA
DD6D-46E9-89CB-91E383F125EA,A50A1E36-1BF5-4127-B229-FC1C14AD8246,705D53F9-C0AF-4AB7-B0A
. . .

@ilya071294
Copy link
Copy Markdown
Contributor Author

Can it be reproduced in ISQL ?

No. It's a bit hard to reproduce because the server should be abnormally terminated before a page with a new blob is written to the disk while a page with a modified record version is already written.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants