Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part of the pages of the second level blobs is not released when deleting relations. [CORE5618] #5884

Closed
firebird-automations opened this issue Sep 20, 2017 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @Logash

Problem in the function "delete_tail" in the block where the pages of blobs of the second level are released. When you get the end of data containing page numbers of second-level blobs, you do not need to subtract the header size, otherwise 7 pages remain occupied.

const ULONG * const end2 = page2 + ((bpage-> blp_length - BLP_SIZE) / sizeof (ULONG));

If I'm right I prepare a pull request.

Commits: 1824acb bc845f6 9860731 FirebirdSQL/fbt-repository@ad5695c

@firebird-automations
Copy link
Collaborator Author

Commented by: @Logash

Test:

create database 'localhost:D:\RedSoft\database\RELEASE_PAGE.FDB' user 'SYSDBA' password 'masterkey';

CREATE TABLE NEW_TABLE (
ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
TESTF BLOB SUB_TYPE 0 SEGMENT SIZE 80
);

ALTER TABLE NEW_TABLE ADD CONSTRAINT PK_NEW_TABLE PRIMARY KEY (ID);
COMMIT;

ADD NEW_TABLE;
D:\Firebird-debuginfo-3.0.2.32703-0.i686.tar.gz;
COMMIT;

DROP TABLE NEW_TABLE;
COMMIT;

Launched the gfix utility:
gfix.exe -v -fu localhost:D:\RedSoft\database\RELEASE_PAGE.FDB -user SYSDBA -pa masterkey

____________________________________________________________________________
firebird.log (source)

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Validation started

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 2222 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 2223 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 2224 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 2225 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 2226 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 2227 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 2228 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 4265 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 4266 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 4267 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 4268 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 4269 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 4270 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 4271 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 6308 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 6309 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 6310 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 6311 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 6312 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 6313 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Warning: Page 6314 is an orphan

DESKTOP-4IG43PM Thu Sep 28 16:38:14 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Validation finished: 0 errors, 21 warnings, 21 fixed

____________________________________________________________________________
firebird.log (Without BLP_SIZE )
____________________________________________________________________________

DESKTOP-4IG43PM Thu Sep 28 16:44:30 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Validation started

DESKTOP-4IG43PM Thu Sep 28 16:44:30 2017
Database: D:\REDSOFT\DATABASE\RELEASE_PAGE.FDB
Validation finished: 0 errors, 0 warnings, 0 fixed

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Fixed by Denis Logashov,
thanks

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0.3 [ 10810 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

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

No branches or pull requests

1 participant