New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexOutOfBounds when storing with channel count >= 2 (more likely with higher channel count) #150
Comments
I got a similar exception at startup, channels are set to 4 and backup is enabled.
|
Just got the same exception as i just posted with 2 channels and no Backup... |
I have set my channel count to 16 and disabled the setup backup and now I also get the same exception on the second start. So it seems that it has to do with the channel count and not with the backup. |
With my initial attempts, I could not reproduce this. |
100% reproducible on my side: final List<String> root = new ArrayList<>();
final NioFileSystem fs = NioFileSystem.New();
final EmbeddedStorageManager storageManager = EmbeddedStorage.Foundation()
.setConfiguration(
StorageConfiguration.Builder()
.setChannelCountProvider(StorageChannelCountProvider.New(4))
.setBackupSetup(
StorageBackupSetup.New(
StorageBackupFileProvider.Builder(fs)
.setDirectory(fs.ensureDirectoryPath("backup"))
.createFileProvider()
)
)
.createConfiguration()
)
.setRoot(root)
.createEmbeddedStorageManager()
.start();
root.add("HEHE");
storageManager.storeRoot();
storageManager.shutdown();
|
Some additional observations: To get the one.microstream.exceptions.IndexBoundsException: Index out of bounds: 0 not in [0;0[ (StartIndex >= bound) exception with fh’s code I need do disable the Backup and run it three times. |
Further debugging showed the following: |
Actually, the problem is caused when 0 bytes are read from a file. Nevertheless it should be investigated, what causes the empty writes and reads, or what purpose they serve. |
The Zero-sized file is created during housekeeping in the second run: |
Ich kann das nicht mehr nachvolziehen. Ok |
Tested on current master (80fc56f)
Whenever I start the storage with backup enabled and a channel count of 2, the first start has no problems. But when I start the application again, it will give me an IndexOutOfBounds when trying to copy a channel file to the backup location. This doesn't happen when the channel count is 1.
If the channel count is greater or equal to 4 then I always get this exception on the first store.
This is my code:
(The sleep is there so the exception output doesn't overlap with the exception message that comes from the shutdown)
Exception when starting with channel count of 4:
The text was updated successfully, but these errors were encountered: