|
| | Pages () |
| | Default constructor. More...
|
| |
| | ~Pages () noexcept |
| | Destructor. More...
|
| |
| void | add (page_no_t page_no, const byte *page, uint32_t n_bytes) noexcept |
| | Add a page frame to the doublewrite recovery buffer. More...
|
| |
| void | add_entry (Page_entry &pg_entry) |
| | Add a page entry from reduced doublewrite buffer to vector. More...
|
| |
| void | done_loading_prepare_for_recovery () noexcept |
| | Indicates that all add() calls were done, and it is time to prepare this data structure for subsequent recover() calls. More...
|
| |
| const byte * | find (const page_id_t &page_id) const noexcept |
| | Find a doublewrite copy of a page. More...
|
| |
| const byte * | get_first_page_content_for_recovery (space_id_t space_id, page_size_t page_size, const std::string &file_path, const byte *page_content) const |
| | Checks if content of the first page provided from the specified space requires recovery from the Double-write Buffer. More...
|
| |
| void | dblwr_recover_page (const fil_space_t &space, page_no_t page_no, byte *dblwr_page) noexcept |
| | Checks if Double-write recovery of the specified tablespace page is needed. More...
|
| |
| bool | is_actual_page_corrupted (const fil_space_t &space, const page_id_t &page_id) |
| | Checks if page in tablespace is corrupted or an all-zero page. More...
|
| |
| std::optional< lsn_t > | get_max_lsn_of_reduced_page_entries (const page_id_t &page_id) const noexcept |
| | Check if page was logged in reduced doublewrite buffer mode, and if so also return the maximum page LSN mentioned for all entries for this page ID. More...
|
| |
| void | recover (fil_space_t &space) noexcept |
| | Restore corrupted pages of the tablespace from the double write buffer. More...
|
| |
| void | check_missing_tablespaces () const noexcept |
| | Check if some pages could be restored because of missing tablespace IDs. More...
|
| |
| Buffers & | get_pages () noexcept |
| | Object the vector of pages. More...
|
| |
Pages recovered from the doublewrite buffer.
Checks if Double-write recovery of the specified tablespace page is needed.
Checks if the provided image of the dblwr_page from the Double-write buffer is usable (non-zero and not corrupted) and if so, checks if the space 's page page_no is corrupted, in which case it uses the provided dblwr_page image to restore it. In case of any errors (IO errors, out of bounds space access) we crash the server as it means the tablespace is corrupted beyond our ability to recover and we should not attempt any more actions.
- Parameters
-
| [in] | space | Tablespace the page belongs to |
| [in] | page_no | Page number in the tablespace |
| [in] | dblwr_page | Data loaded from Double-write buffer to write to <space, page_no> |
| void recv::Pages::detect_corruption_from_reduced_entries |
( |
const fil_space_t & |
space | ) |
|
|
privatenoexcept |
Checks if there are any corrupted pages in the tablespace that can be found in the reduced double write buffer.
Scans the stored double write buffer reduced entries for mentions of pages from the specified space, and for each such page checks if tablespace file contains a corrupted version of it and if so, we abort the Server. We cannot recover page because the entire page is not logged only an entry of space_id, page_id, LSN is logged. It is expected that the user restores from backup.
- Parameters
-
| [in] | space | Tablespace to check in reduced pages. |
| const byte * recv::Pages::get_first_page_content_for_recovery |
( |
space_id_t |
space_id, |
|
|
page_size_t |
page_size, |
|
|
const std::string & |
file_path, |
|
|
const byte * |
page_content |
|
) |
| const |
Checks if content of the first page provided from the specified space requires recovery from the Double-write Buffer.
If the supplied page_content has a valid not corrupted page, no action is taken. If it is not, then we try to get a non-corrupted copy from the Double-write Buffer. If there are any entries in the Reduced Double-write pages list, we may crash.
- Parameters
-
| [in] | space_id | ID of the space to be checked. |
| [in] | page_size | Page size structure to use for the tablespace page manipulation. |
| [in] | file_path | Path of a file to be used for error reporting. |
| [in] | page_content | Content of the first page of the specified tablespace read from the disk. The buffer must hold at least page_size.physical() bytes. |
- Returns
- pointer to
page_content if the page does not require recovery, a pointer to page contents from the Double-write Buffer or nullptr if page_content is corrupted, but there's no valid image of it in the Double-write Buffer to restore it from.
Restore corrupted pages of the tablespace from the double write buffer.
Iterates over the previously loaded double write buffer pages, but only ones that are not corrupted, searching for mentions of pages from the specified space, and for each such page checks if tablespace file contains a corrupted version of it and if so, restores it from the backup in image found in double write buffer page, unless this is impossible because the double write buffer page does not contain the body (in reduced, detect-only mode). In case of any errors (IO errors, out of bounds space access) we crash the server.
- Parameters
-
| [in] | space | Tablespace to restore pages in. |