-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BugFix] Fix BlobStorage use different broker in a client request bug #48856
Conversation
Signed-off-by: HangyuanLiu <[email protected]>
@@ -770,7 +785,7 @@ public Status checkPathExist(String remotePath) { | |||
|
|||
TBrokerCheckPathExistResponse rep = ThriftRPCRequestExecutor.callNoRetry( | |||
ThriftConnectionPool.brokerPool, | |||
getBrokerAddress(), | |||
address, | |||
client -> client.checkPathExist(req)); | |||
|
|||
TBrokerOperationStatus opst = rep.getOpStatus(); |
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 most risky bug in this code is:
Inconsistent broker address variable name in the checkPathExist
method.
You can modify the code like this:
@@ -762,7 +776,7 @@ public Status checkPathExist(String remotePath) {
if (!hasBroker) {
return checkPathExistWithoutBroker(remotePath);
}
+ TNetworkAddress brokerAddress = getBrokerAddress();
// check path
try {
@@ -770,7 +785,7 @@ public Status checkPathExist(String remotePath) {
TBrokerCheckPathExistResponse rep = ThriftRPCRequestExecutor.callNoRetry(
ThriftConnectionPool.brokerPool,
- getBrokerAddress(), // Incorrect variable name here
+ brokerAddress, // Consistent with the rest of the code
client -> client.checkPathExist(req));
TBrokerOperationStatus opst = rep.getOpStatus();
Quality Gate passedIssues Measures |
[FE Incremental Coverage Report]❌ fail : 2 / 12 (16.67%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
@Mergifyio backport branch-3.3 |
✅ Backports have been created
|
…#48856) Signed-off-by: HangyuanLiu <[email protected]> (cherry picked from commit 72e4bf5)
… (backport #48856) (#48936) Co-authored-by: Harbor Liu <[email protected]>
…StarRocks#48856) Signed-off-by: HangyuanLiu <[email protected]>
Why I'm doing:
PR #48292 introduced a bug. If there is no corresponding broker locally, getBroker will return an available broker at random. However, we must ensure that multiple requests for one operation are sent to the same broker.
What I'm doing:
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: