ChenSammi commented on code in PR #9858:
URL: https://github.com/apache/ozone/pull/9858#discussion_r2910567565
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestDiskBalancerPolicyPerformance.java:
##########
@@ -181,90 +177,165 @@ private void testPolicyPerformance(String policyName,
ContainerChoosingPolicy po
for (int i = 0; i < NUM_THREADS; i++) {
executor.submit(() -> {
try {
- long threadStart = System.nanoTime();
- int containerChosen = 0;
- int containerNotChosen = 0;
+ int containerCandidateChosen = 0;
+ int containerCandidateNotChosen = 0;
int failures = 0;
- // Choose a random volume
- HddsVolume srcVolume = volumes.get(rand.nextInt(NUM_VOLUMES));
- HddsVolume destVolume;
-
- do {
- destVolume = volumes.get(rand.nextInt(NUM_VOLUMES));
- } while (srcVolume.equals(destVolume));
for (int j = 0; j < NUM_ITERATIONS; j++) {
+ // Block all volumes except the highest-util (source) - no
destination has space
+ if (rand.nextDouble() < 0.05 && volumes.size() >= 2) {
+ List<HddsVolume> sorted = new ArrayList<>(volumes);
+ sorted.sort(Comparator.comparingDouble(v ->
+ v.getCurrentUsage().getUsedSpace() / (double) Math.max(1,
v.getCurrentUsage().getCapacity())));
+ for (int k = 0; k < sorted.size() - 1; k++) {
+ HddsVolume v = sorted.get(k);
+ long avail = v.getCurrentUsage().getAvailable();
+ if (avail > 0) {
+ v.incCommittedBytes(avail);
Review Comment:
Here are 20 volumes, and 10000 iterates, 5% possibility(0.05) to set a
volume to full, will it cause all volume to be full after a few iterates?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]