Skip to content
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

Potential archive segment filename collision #414

Closed
zyulyaev opened this issue Oct 16, 2017 · 1 comment
Closed

Potential archive segment filename collision #414

zyulyaev opened this issue Oct 16, 2017 · 1 comment

Comments

@zyulyaev
Copy link

Because of a typo in this line:
https://github.com/real-logic/aeron/blob/b55b005d6210f0622585793d8f80ef1a5488db6c/aeron-archive/src/main/java/io/aeron/archive/Archive.java#L756
one may get the same filename for different recordingId and segmentIndex pair. E.g. recordingId=1, segmentIndex=2 and recordingId=2,segmentIndex=1 gives you the same filename.

Solution is to replace single quotes with double quotes, so the line looks like:

return recordingId + "-" + segmentIndex + Configuration.RECORDING_SEGMENT_POSTFIX;

I believe this is what it was intended to be.

@mjpt777
Copy link
Contributor

mjpt777 commented Oct 16, 2017

Thanks. Yes you are correct. I've pushed a fix.

@mjpt777 mjpt777 closed this as completed Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants