Skip to content

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

Open
nikita15p wants to merge 1 commit into
apache:trunkfrom
nikita15p:fix-FLUME-3473
Open

[FLUME-3473] fixed testMinimumRequiredSpaceTooSmallforPut test by changing buffer size dynamic#411
nikita15p wants to merge 1 commit into
apache:trunkfrom
nikita15p:fix-FLUME-3473

Conversation

@nikita15p

@nikita15p nikita15p commented May 21, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

1 participant