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

[FLUME-3473] fixed testMinimumRequiredSpaceTooSmallforPut test by changing buffer size dynamic #411

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

nikita15p
Copy link
Contributor

@nikita15p nikita15p commented May 21, 2023

Current state: Since the buffer size is limited by the size

byte[] buffer = new byte[64 * 1024];

This was causing while loop to execute limited by buffer size. This was causing test failure since "checkpointDir.getUsableSpace() > minimumRequiredSpace" was still satisfied even after the byte size is exhausted.

The change in PR introduces dynamic size of buffer, so that always we get checkpointDir.getUsableSpace() <= minimumRequiredSpace post while loop and hence test always passes.
Tested it in pipeline many times and it passed always with this fix.

A snippet of TestLog-output.txt with extra logs to check if the condition is satisfied.

2023-05-21 19:40:50,774 (main) [INFO - org.apache.flume.channel.file.TestLog.doTestMinimumRequiredSpaceTooSmallForPut(TestLog.java:245)] checkpointDir.getUsableSpace(): 449352470528
2023-05-21 19:40:50,774 (main) [INFO - org.apache.flume.channel.file.TestLog.doTestMinimumRequiredSpaceTooSmallForPut(TestLog.java:246)] minimumRequiredSpace: 449358696448
2023-05-21 19:40:50,791 (main) [INFO - org.apache.flume.channel.file.Log.put(Log.java:656)] usableSpace449352470528
2023-05-21 19:40:50,791 (main) [INFO - org.apache.flume.channel.file.Log.put(Log.java:657)] minimumRequiredSpace449358696528
2023-05-21 19:40:50,791 (main) [INFO - org.apache.flume.channel.file.Log.put(Log.java:659)] usableSpace <= requiredSpace

@nikita15p
Copy link
Contributor Author

@rgoers please review it

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

Successfully merging this pull request may close these issues.

None yet

1 participant