Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
4.0.0, 4.1.0
-
None
Description
Currently, when compacting a GSI file, the Indexer will create a new file with next revision number (i.e. data.fdb.5 will be compacted into data.fdb.6).
This has been seen to cause issues (such as in MB-18651) where there are two validly named files. This requires logic to determine which file should be used when the indexer starts (for example a restart during compaction).
The current method of selecting the lowest numbered file (with the proposed fix for MB-18651) is adequate, but relies on files always being handled perfectly. For example if for some reason a file with rev .3 is not correctly deleted from the directory, the indexer will pick this up following a restart, even if it was previously on a much higher revision.
In order to mitigate this, we could have the compacting file be named with .compact, and then renamed when needed. This eliminates the potential for a half written file to be picked up as valid, and also allows the logic to be to pick up the highest valid revision present.