Skip to content

Commit

Permalink
fixes bug in merge tablet reservations (#4604)
Browse files Browse the repository at this point in the history
The fate step that reserves tablets for merge was signaling it
was ready when it was not in the case where its scan of the
metadata table took 0ms.  This was causing some ITs to fail.  The
bug was introduced in #4574
  • Loading branch information
keith-turner committed May 24, 2024
1 parent 025a821 commit f6828d3
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,10 @@ public long isReady(FateId fateId, Manager env) throws Exception {
}

long sleepTime = Math.min(Math.max(1000, count), maxSleepTime);
if (locations > 0 || otherOps > 0 || wals > 0) {
// need to wait on these tablets
return sleepTime;
}

if (opsSet != opsAccepted.get()) {
// not all operation ids were set
return sleepTime;
if (locations > 0 || otherOps > 0 || wals > 0 || opsSet != opsAccepted.get()) {
// need to wait on these tablets, must return non-zero to indicate not ready so need to handle
// case of sleepTime being zero
return Math.max(1, sleepTime);
}

// operations ids were set on all tablets and no tablets have locations, so ready
Expand Down

0 comments on commit f6828d3

Please sign in to comment.