-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Comments
@coderwf thanks for the report! Are you able to provide a test case for this? One of the tests in https://github.com/trinodb/trino/blob/232916b75d415a5eb643cf922492eb8513d99aae/lib/trino-filesystem-cache-alluxio/src/test/java/io/trino/filesystem/alluxio/TestAlluxioCacheFileSystemAccessOperations.java could be adapted to catch this. |
@jkylling ok |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There may be a bug in Method putBuffer of AlluxioInputHelper,as shown bellow:
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:
so the var bytesToReadInPage in method putBuffer shoud be :
long start = pageOffset + (pageId.getPageIndex() * pageSize);
int bytesToReadInPage = Ints.saturatedCast(min(pageSize - pageOffset, fileLength - start));
The text was updated successfully, but these errors were encountered: