[
https://issues.apache.org/jira/browse/IGNITE-27980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aleksandr Polovtsev updated IGNITE-27980:
-----------------------------------------
Description:
When compacting a segment file, we also update {{IndexFileMetaArray}} in
IndexFileManager. {{onIndexCompacted}} expects each IndexFileMeta in to point a
continuous range of segment files (in terms of file ordinals). However, the
following situation breaks this invariant:
1. Log entries for raft group A are present in segment file 1;
2. File rollover happens and we start writing entries only for group B in
segment file 2;
3. File rollover happens again. During the checkpoint for segment file 2 we
will only create corresponding IndexFileMeta only for group B, because there
are no entries for group A in that file;
4. We start writing entries for group A in segment file 3.
After three checkpoints the IndexFileMetaArray for group A will look like this:
[IndexFileMeta(fileOrdinal=1), IndexFileMeta(fileOrdinal=3)].
To fix this, we need to insert an empty IndexFileMeta to signal that there's a
meta with fileOrdinal=2, but it's simply empty.
> Save empty index meta if a group is missing
> -------------------------------------------
>
> Key: IGNITE-27980
> URL: https://issues.apache.org/jira/browse/IGNITE-27980
> Project: Ignite
> Issue Type: Bug
> Reporter: Aleksandr Polovtsev
> Assignee: Aleksandr Polovtsev
> Priority: Major
> Labels: ignite-3
>
> When compacting a segment file, we also update {{IndexFileMetaArray}} in
> IndexFileManager. {{onIndexCompacted}} expects each IndexFileMeta in to point
> a continuous range of segment files (in terms of file ordinals). However, the
> following situation breaks this invariant:
> 1. Log entries for raft group A are present in segment file 1;
> 2. File rollover happens and we start writing entries only for group B in
> segment file 2;
> 3. File rollover happens again. During the checkpoint for segment file 2 we
> will only create corresponding IndexFileMeta only for group B, because there
> are no entries for group A in that file;
> 4. We start writing entries for group A in segment file 3.
> After three checkpoints the IndexFileMetaArray for group A will look like
> this: [IndexFileMeta(fileOrdinal=1), IndexFileMeta(fileOrdinal=3)].
> To fix this, we need to insert an empty IndexFileMeta to signal that there's
> a meta with fileOrdinal=2, but it's simply empty.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)