-
Satya Bodapati authored
Problem: -------- A compressed table is created in 5.7 with KEY_BLOCK_SIZE as 8. After upgrading to 8.0 and subsequent crash recovery on the compressed table fails with error that it doesn't have minimum expected size. The minimum size expected in 5.7 is (FIL_IBD_INITIAL_FILE_SIZE) 4 * UNIV_PAGE_SIZE. Note that the page size is UNIV_PAGE_SIZE. This means even for compressed tables with 1k, 2k, 4k,etc we still create IBD file with 4 * UNIV_PAGE_SIZE bytes. Ideally we should we have used 4 * page_size.physical() bytes. In 8.0, the minimum size expected is increased to 6 due to two extra SDI indexes per tablespace. Later when one SDI index is removed (as part of WL#9538), minimum size should have been reduced to 5 (another bug). As part of upgrade, we add one SDI index to tablespace but it doesn't extend the physical tablespace size to FIL_IBD_INITIAL_FILE_SIZE * UNIV_PAGE_SIZE bytes. Index creation only add one/two extra page_size.physical() bytes. So subsequent crash recovery on this tablespace fails because of size mismatch. Fix: ---- 1. Change the minimum expected size (FIL_IBD_INITIAL_FILE_SIZE) from 6 to 5. (We have only one extra SDI index) 2. Create IBD file with FIL_IBD_INITIAL_FILE_SIZE * page_size.physical() bytes instead of FIL_IBD_INITIAL_FILE_SIZE * UNIV_PAGE_SIZE bytes. 3. Dont read page 0 assuming UNIV_PAGE_SIZE bytes. To determine page_size of tablespace, first read UNIV_ZIP_MIN_SIZE bytes(1K) bytes and get tablespace flags, space_id etc. Once the page_size is derived from tablespace flags, read the tablespace using the page_size. Reviewed-By:
Bin Su <bin.x.su@oracle.com> RB: 17797
Satya Bodapati authoredProblem: -------- A compressed table is created in 5.7 with KEY_BLOCK_SIZE as 8. After upgrading to 8.0 and subsequent crash recovery on the compressed table fails with error that it doesn't have minimum expected size. The minimum size expected in 5.7 is (FIL_IBD_INITIAL_FILE_SIZE) 4 * UNIV_PAGE_SIZE. Note that the page size is UNIV_PAGE_SIZE. This means even for compressed tables with 1k, 2k, 4k,etc we still create IBD file with 4 * UNIV_PAGE_SIZE bytes. Ideally we should we have used 4 * page_size.physical() bytes. In 8.0, the minimum size expected is increased to 6 due to two extra SDI indexes per tablespace. Later when one SDI index is removed (as part of WL#9538), minimum size should have been reduced to 5 (another bug). As part of upgrade, we add one SDI index to tablespace but it doesn't extend the physical tablespace size to FIL_IBD_INITIAL_FILE_SIZE * UNIV_PAGE_SIZE bytes. Index creation only add one/two extra page_size.physical() bytes. So subsequent crash recovery on this tablespace fails because of size mismatch. Fix: ---- 1. Change the minimum expected size (FIL_IBD_INITIAL_FILE_SIZE) from 6 to 5. (We have only one extra SDI index) 2. Create IBD file with FIL_IBD_INITIAL_FILE_SIZE * page_size.physical() bytes instead of FIL_IBD_INITIAL_FILE_SIZE * UNIV_PAGE_SIZE bytes. 3. Dont read page 0 assuming UNIV_PAGE_SIZE bytes. To determine page_size of tablespace, first read UNIV_ZIP_MIN_SIZE bytes(1K) bytes and get tablespace flags, space_id etc. Once the page_size is derived from tablespace flags, read the tablespace using the page_size. Reviewed-By:
Bin Su <bin.x.su@oracle.com> RB: 17797
Loading