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

Fix the inconsistent between listen peerURL and advertise peerURL #19136

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Jan 7, 2025

Symptom

logger.go:146: 2025-01-07T10:48:59.222Z	WARN	m1	failed to reach the peer URL	{"member": "m1", "address": "http://127.0.0.1:1234/version", "remote-member-id": "8453db59c251d047", "error": "Get \"http://127.0.0.1:1234/version\": dial tcp 127.0.0.1:1234: connect: connection refused"}

logger.go:146: 2025-01-07T10:51:09.907Z	INFO	m1	sending database snapshot	{"member": "m1", "snapshot-index": 10, "remote-peer-id": "2c0c6ac2c3d63c1e", "bytes": 108356, "size": "108 kB", "URLs": "unix://127.0.0.1:2100542460"}
logger.go:146: 2025-01-07T10:51:09.907Z	WARN	m1	failed to send database snapshot	{"member": "m1", "snapshot-index": 10, "remote-peer-id": "2c0c6ac2c3d63c1e", "bytes": 108356, "size": "108 kB", "error": "dial tcp 127.0.0.1:1234: connect: connection refused"}

Root cause & solution

In test case TestMemberPromote, it sets the new learner's peerURL as http://127.0.0.1:1234 , see below,

urls := []string{"http://127.0.0.1:1234"}
memberAddResp, err := capi.MemberAddAsLearner(context.Background(), urls)

But actually the integration test framework doesn't use the peerURL specified by users at all; instead it generates a peerURL by itself, see below. This PR tries to fix the inconsistency.

pln := NewLocalListener(t)
m.PeerListeners = []net.Listener{pln}
m.PeerURLs, err = types.NewURLs([]string{peerScheme "://" pln.Addr().String()})

cc @serathius @jmhbnz @ivanvc @fuweid @siyuanfoundation

Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, serathius

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.81%. Comparing base (fce823a) to head (e78cec8).
Report is 2 commits behind head on main.

Additional details and impacted files

see 20 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19136       /-   ##
==========================================
  Coverage   68.79%   68.81%    0.02%     
==========================================
  Files         420      420              
  Lines       35640    35640              
==========================================
  Hits        24518    24527        9     
  Misses       9697     9682      -15     
- Partials     1425     1431        6     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fce823a...e78cec8. Read the comment docs.

@ahrtr
Copy link
Member Author

ahrtr commented Jan 7, 2025

/test pull-etcd-e2e-386

@ahrtr ahrtr merged commit aac7ef6 into etcd-io:main Jan 7, 2025
36 checks passed
@ahrtr ahrtr deleted the member_promote_test_20250107 branch January 7, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants