Skip to content

HBASE-29958 Improve log messages#7922

Merged
anmolnar merged 16 commits intoapache:HBASE-29081_rebasedfrom
sharmaar12:log-message_rebase
Mar 26, 2026
Merged

HBASE-29958 Improve log messages#7922
anmolnar merged 16 commits intoapache:HBASE-29081_rebasedfrom
sharmaar12:log-message_rebase

Conversation

@sharmaar12
Copy link

No description provided.

@sharmaar12 sharmaar12 marked this pull request as ready for review March 12, 2026 17:50
Copy link
Contributor

@anmolnar anmolnar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. A quick question.

}
} catch (IOException e) {
// We still update the flag, but log that the operation failed.
LOG.error("Failed to perform file operation for read-only switch. "
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anmolnar On the contrary to above discussion, I think we should throw exception here as this case will cause data corruption because you are not able to create the cluster file but you now cluster is active.

I also think, even if this throw exception, then master will not change its readonly state. But how can we notify Region's OnConfigurationChange to abort changing the state because I think calls to configuration observers are executed in parallel.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. Switching to non-readonly mode or in other words enabling write operation in the cluster is a risky operation and we should make sure that it's done properly and completely. If we're unable to write the lock file for some reason, we should deny the entire mode switch.

On the other hand, we need to make progress and fixing such kind of things is not scope of this ticket, so I suggest to submit this first and open a new ticket to confirm and address the above mentioned problems.

Comment on lines 112 to 113
LOG.debug("Active cluster file already exists at: {}. No need to create it again.",
activeClusterFile);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see an implementation gap here as well. Being the file present alone doesn't guarantee that we could enable read-write mode. We need to make sure that suffix file contains the suffix of this cluster.

@anmolnar
Copy link
Contributor

I've fun the failing unit test 3 times locally without an error, so I go ahead and merge this patch.

@anmolnar anmolnar merged commit c82981e into apache:HBASE-29081_rebased Mar 26, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants