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

HBASE-28652 Backport HBASE-21785 master reports open regions as RITs … #5979

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ public void setRITCountOverThreshold(final int ritCount) {
}

@Override
public void setRITOldestAge(final long ritCount) {
ritOldestAgeGauge.set(ritCount);
public void setRITOldestAge(final long ritOldestAge) {
ritOldestAgeGauge.set(ritOldestAge);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,13 @@ protected void update(final AssignmentManager am) {
private void update(final Collection<RegionState> regions, final long currentTime) {
for (RegionState state : regions) {
totalRITs++;
final long ritTime = currentTime - state.getStamp();
final long ritStartedMs = state.getStamp();
if (ritStartedMs == 0) {
// Don't output bogus values to metrics if they accidentally make it here.
LOG.warn("The RIT {} has no start time", state.getRegion());
continue;
}
final long ritTime = currentTime - ritStartedMs;
if (ritTime > ritThreshold) {
if (ritsOverThreshold == null) {
ritsOverThreshold = new HashMap<String, RegionState>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ public boolean isSplit() {

public long getLastUpdate() {
TransitRegionStateProcedure proc = this.procedure;
return proc != null ? proc.getLastUpdate() : lastUpdate;
if (proc != null) {
long lastUpdate = proc.getLastUpdate();
return lastUpdate != 0 ? lastUpdate : proc.getSubmittedTime();
}
return lastUpdate;
}

public void setLastHost(final ServerName serverName) {
Expand Down