Skip to content

clientv3: fix dialer for maintenance API#9880

Closed
gyuho wants to merge 2 commits intoetcd-io:masterfrom
gyuho:fix-dialer
Closed

clientv3: fix dialer for maintenance API#9880
gyuho wants to merge 2 commits intoetcd-io:masterfrom
gyuho:fix-dialer

Conversation

@gyuho
Copy link
Copy Markdown
Contributor

@gyuho gyuho commented Jun 22, 2018

Without patch

=== RUN   TestMaintenanceStatus
dial proto "unix" host "localhost:39491187763008498080" | dialEp "unix://localhost:39491187763008498080" | target "endpoint://client-bmdwzcpdjwn8/localhost:39491187763008498080" | ep "localhost:39491187763008498080"
dial proto "unix" host "localhost:57863826249668888540" | dialEp "unix://localhost:57863826249668888540" | target "endpoint://client-bmdwzcpe4ao8/localhost:57863826249668888540" | ep "localhost:57863826249668888540"
dial proto "unix" host "localhost:33033510950554123550" | dialEp "unix://localhost:33033510950554123550" | target "endpoint://client-bmdwzcpeiijr/localhost:33033510950554123550" | ep "localhost:33033510950554123550"
dial proto "unix" host "localhost:57863826249668888540" | dialEp "unix://localhost:57863826249668888540" | target "endpoint://client-bmdwzcpg64tf/localhost:39491187763008498080" | ep "localhost:39491187763008498080"
dial proto "unix" host "localhost:33033510950554123550" | dialEp "unix://localhost:33033510950554123550" | target "endpoint://client-bmdwzcpg64tf/localhost:39491187763008498080" | ep "localhost:39491187763008498080"
dial proto "unix" host "localhost:39491187763008498080" | dialEp "unix://localhost:39491187763008498080" | target "endpoint://client-bmdwzcpg64tf/localhost:39491187763008498080" | ep "localhost:39491187763008498080"
dial proto "unix" host "localhost:39491187763008498080" | dialEp "unix://localhost:39491187763008498080" | target "endpoint://client-bmdwzcpg64tf/localhost:39491187763008498080" | ep "localhost:39491187763008498080"
dial proto "unix" host "localhost:39491187763008498080" | dialEp "unix://localhost:39491187763008498080" | target "endpoint://client-bmdwzcpg64tf/localhost:57863826249668888540" | ep "localhost:57863826249668888540"
dial proto "unix" host "localhost:39491187763008498080" | dialEp "unix://localhost:39491187763008498080" | target "endpoint://client-bmdwzcpg64tf/localhost:33033510950554123550" | ep "localhost:33033510950554123550"
--- FAIL: TestMaintenanceStatus (0.17s)
	maintenance_test.go:102: #1: status returned duplicate member ID with 0eb083ea01d9b6c4
	maintenance_test.go:102: #2: status returned duplicate member ID with 0eb083ea01d9b6c4
	maintenance_test.go:112: no leader found

So gRPC is passing the endpoint used for initial client connection to the custom dialer, not the endpoint target that client passes to the dial method. So, we need special handling when two given hosts are different.

/cc @jpbetz

gyuho added 2 commits June 22, 2018 10:19
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
If a given dial target is different than balancer connection
endpoint, the dial target should be used.

Fixed all maintenance API calls.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Copy link
Copy Markdown
Contributor

@jpbetz jpbetz left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for fixing!

@gyuho gyuho added the WIP label Jun 22, 2018
@gyuho gyuho self-assigned this Jul 5, 2018
@gyuho
Copy link
Copy Markdown
Contributor Author

gyuho commented Jul 10, 2018

@jpbetz Think we need improve picker generator logic. Let me create a separate issue to explain the root cause and proposed solution.

@gyuho gyuho closed this Jul 10, 2018
@jpbetz
Copy link
Copy Markdown
Contributor

jpbetz commented Jul 10, 2018

@gyuho Sounds good. Let me know if you need me to pitch in on any code changes.

@gyuho gyuho deleted the fix-dialer branch June 3, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants