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

AlluxioHelper bug causes cache miss #23172

Closed
coderwf opened this issue Aug 29, 2024 · 4 comments · Fixed by #23175
Closed

AlluxioHelper bug causes cache miss #23172

coderwf opened this issue Aug 29, 2024 · 4 comments · Fixed by #23175

Comments

@coderwf
Copy link
Contributor

coderwf commented Aug 29, 2024

There may be a bug in Method putBuffer of AlluxioInputHelper,as shown bellow:
image

IF the method seek(pos) was called in AlluxioInputStream, assume pos is 1000,and the fileLength is 110,position is 1000,then the bytesToReadInPage and bytesRead is 100, bufferEndPosition will be 100 if this is a first page, bufferStartPosition is 0.
it means this buffer cached the data position 0, 100,it will cause a cache miss in outer next method doBufferRead:
image

so the var bytesToReadInPage in method putBuffer shoud be :
long start = pageOffset + (pageId.getPageIndex() * pageSize);
int bytesToReadInPage = Ints.saturatedCast(min(pageSize - pageOffset, fileLength - start));

@coderwf
Copy link
Contributor Author

coderwf commented Aug 29, 2024

@jkylling

@jkylling
Copy link
Contributor

@coderwf
Copy link
Contributor Author

coderwf commented Aug 30, 2024

@jkylling ok

@coderwf
Copy link
Contributor Author

coderwf commented Aug 30, 2024

#23175 PR For this issue,please take a look @jkylling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants