-
Notifications
You must be signed in to change notification settings - Fork 449
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
Add test for tserver.wal.max.referenced #5250
base: 2.1
Are you sure you want to change the base?
Conversation
int total = 0; | ||
for (Entry<TServerInstance,List<UUID>> entry : wals.getAllMarkers().entrySet()) { | ||
total += entry.getValue().size(); | ||
} | ||
return total; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write ahead logs can have different states. For this test do not care about the one in the open state (every tserver will always have 2 open), but want to count the non open ones.
int total = 0; | |
for (Entry<TServerInstance,List<UUID>> entry : wals.getAllMarkers().entrySet()) { | |
total += entry.getValue().size(); | |
} | |
return total; | |
return wals.getAllState().values().stream().filter(walState -> walState != WalStateManager.WalState.OPEN).count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in a176b85
|
||
private void writeData(AccumuloClient client, String table, int startRow, int endRow) | ||
throws Exception { | ||
try (BatchWriter bw = client.createBatchWriter(table, new BatchWriterConfig())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could modify this method to write 2XTSERV_WAL_MAX_SIZE data to a single tablet by generating rows that fall within a target tablet and using the Mutation.estimatedMemoryUsed() method.
while(totalWritten < 2*hdfsMinBlockSize){
Mutation m = ...
bw.addMutation(m);
totalWritten+=m.estimateMemoryUsed();
}
Could use the same row, it does not matter for the walog it will keep adding it even if it is the same row.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 3bc2502
|
||
log.info("Created table {} with splits. Now writing data.", tableName); | ||
|
||
// Write data multiple times until we see the WAL count exceed WAL_MAX_REFERENCED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way this writes data it seems out of sync w/ the tablets. Would be good to push a lot of data to single tablet until a new non-open log has been produced and then move to the next tablet.
cfg.setProperty(Property.TSERV_WAL_MAX_SIZE, hdfsMinBlockSize); | ||
// Set the max number of WALs that can be referenced | ||
cfg.setProperty(Property.TSERV_WAL_MAX_REFERENCED, Integer.toString(WAL_MAX_REFERENCED)); | ||
cfg.setNumTservers(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to increase the amount of memory that tservers can use to hold new data in memory. If this is too low then tservers will minor compaction because memory is low and not because of walogs.
cfg.setProperty(Property.TSERV_MAXMEM,"256M");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 449e457
Co-authored-by: Keith Turner <[email protected]>
Fixes #5200
Adds a a test to make sure that
tserver.wal.max.referenced
works.