Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Notes
Description may not be complete.
Goal
To implement a new checkpoint (described in IGNITE-15818), we will introduce a new entity DeltaFilePageStore, which will be created for each partition at each checkpoint and removed after merging with the FilePageStore (the main partition file) using the compacter.
DeltaFilePageStore will consist of:
- Header (maybe updated in the course of implementation):
- Allocation pageIdx - pageIdx of the last created page;
- Sorted list of pageIdx - allows a binary search to find the file offset for an pageId -> pageIdx;
- Page content - sorted by pageIdx.
What will change for FilePageStore:
- List of class DeltaFilePageStore will be added (from the newest to the oldest by the time of creation);
- Allocation index (pageIdx of the last created page) - it will be logical and contained in the header of FilePageStore. At node start, it will be read from the header of FilePageStore or obtained from the first DeltaFilePageStore (the newest one).
How pages will be read by pageId -> pageIdx:
- Interrogates the class DeltaFilePageStore in order from the newest to the oldest;
- If not found, then we read page from the FilePageStore itself.
Some implementation notes
- Format of the file name for the DeltaFilePageStore is part-%d-delta-%d.bin for example part-1-delta-3.bin where the first digit is the partition identifier, and the second is the serial number of the delta file for this partition;
- Before creating part-1-delta-3.bin, a temporary file part-1-delta-3.bin.tmp will be created at the checkpoint first, then filled, then renamed to part-1-delta-3.bin;
- In each partition and delta file we will store the org.apache.ignite.internal.storage.pagememory.io.PartitionMetaIo, which will be the first page in this file, and it will be special;
- We will not store it in PageMemory (we will not let it be dirty) for optimization and will write it immediately to the delta file at the checkpoint and at the merge with the partition file by the compactor;
- Instead of the allocation index, we will store the logical size of the partition, which we will store in the PartitionMetaIo;
- We will store the list of pageIdx in the header of the delta file.
Attachments
Issue Links
- is a child of
-
IGNITE-15818 [Native Persistence 3.0] Checkpoint, lifecycle and file store refactoring and re-implementation
- Resolved
- is a parent of
-
IGNITE-17231 Optimization of DeltaFilePageStore: improve mapping of pageIdx to file offset
- Open
-
IGNITE-17232 Optimization of DeltaFilePageStore: write new pages directly to FilePageStore
- In Progress
- relates to
-
IGNITE-17246 Get rid of the index partition
- Resolved
-
IGNITE-17267 Preparing a checkpoint for a DeltaFilePageStore
- Resolved
-
IGNITE-17295 Preparing a PartitionMetaIo for a DeltaFilePageStore
- Resolved
-
IGNITE-17372 Implement DeltaFilePageStore
- Resolved
- links to