Skip to content

Conversation

@k8s-infra-cherrypick-robot

This is an automated cherry-pick of #19538

/assign ahrtr

We should use WithCompactPhysical to wait for compaction to finish,
because 50ms sleep can't guarantee compaction is done.

Based on the log, the defragment is finished before compaction, which is
not expected. This patch is to make sure compaction should be finished
before assertation.

```
=========================== defragment ==============
    logger.go:146: 2025-02-27T07:57:18.652Z	INFO	m0	finished defragment	{"member": "m0"}
=====================================================

    logger.go:146: 2025-02-27T07:57:18.652Z	INFO	m0	grpc service status changed	{"member": "m0", "service": "", "status": "SERVING"}
    logger.go:146: 2025-02-27T07:57:18.653Z	INFO	grpc	[[core] [Channel etcd-io#1457]Channel Connectivity change to SHUTDOWN]
    logger.go:146: 2025-02-27T07:57:18.653Z	INFO	grpc	[[core] [Channel etcd-io#1457]Closing the name resolver]
    logger.go:146: 2025-02-27T07:57:18.653Z	INFO	grpc	[[core] [Channel etcd-io#1457]ccBalancerWrapper: closing]
    logger.go:146: 2025-02-27T07:57:18.653Z	INFO	grpc	[[core] [Channel etcd-io#1457 SubChannel etcd-io#1458]Subchannel Connectivity change to SHUTDOWN]
    logger.go:146: 2025-02-27T07:57:18.653Z	INFO	grpc	[[core] [Channel etcd-io#1457 SubChannel etcd-io#1458]Subchannel deleted]
    logger.go:146: 2025-02-27T07:57:18.654Z	INFO	grpc	[[transport] [client-transport 0xc00237bd48] Closing: rpc error: code = Canceled desc = grpc: the client connection is closing]
    logger.go:146: 2025-02-27T07:57:18.654Z	INFO	grpc	[[transport] [client-transport 0xc00237bd48] loopyWriter exiting with error: rpc error: code = Canceled desc = grpc: the client connection is closing]
    logger.go:146: 2025-02-27T07:57:18.654Z	INFO	grpc	[[transport] [server-transport 0xc0006bb520] Closing: EOF]
    logger.go:146: 2025-02-27T07:57:18.654Z	INFO	grpc	[[core] [Channel etcd-io#1457]Channel deleted]
    logger.go:146: 2025-02-27T07:57:18.654Z	INFO	grpc	[[transport] [server-transport 0xc0006bb520] loopyWriter exiting with error: transport closed by client]
    hash.go:82:
        	Error Trace:	/home/prow/go/src/github.com/etcd-io/etcd/server/storage/mvcc/testutil/hash.go:82
        	            				/home/prow/go/src/github.com/etcd-io/etcd/server/storage/mvcc/testutil/hash.go:44
        	Error:      	Not equal:
        	            	expected: testutil.KeyValueHash{Hash:0x94694091, CompactRevision:1278, Revision:2507}
        	            	actual  : testutil.KeyValueHash{Hash:0x58af47dc, CompactRevision:2488, Revision:2507}

        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,4 +1,4 @@
        	            	 (testutil.KeyValueHash) {
        	            	- Hash: (uint32) 2489925777,
        	            	- CompactRevision: (int64) 1278,
        	            	+ Hash: (uint32) 1487882204,
        	            	+ CompactRevision: (int64) 2488,
        	            	  Revision: (int64) 2507
        	Test:       	TestCompactionHash
        	Messages:   	hashes do not match on rev 2488
    cluster.go:1423: ========= Cluster termination started =====================
    logger.go:146: 2025-02-27T07:57:18.655Z	INFO	grpc	[[core] [Channel etcd-io#1377]Channel Connectivity change to SHUTDOWN]
    logger.go:146: 2025-02-27T07:57:18.655Z	INFO	grpc	[[core] [Channel etcd-io#1377]Closing the name resolver]
    logger.go:146: 2025-02-27T07:57:18.655Z	INFO	grpc	[[core] [Channel etcd-io#1377]ccBalancerWrapper: closing]
    logger.go:146: 2025-02-27T07:57:18.656Z	INFO	grpc	[[core] [Channel etcd-io#1377 SubChannel etcd-io#1378]Subchannel Connectivity change to SHUTDOWN]
    logger.go:146: 2025-02-27T07:57:18.656Z	INFO	grpc	[[core] [Channel etcd-io#1377 SubChannel etcd-io#1378]Subchannel deleted]
    logger.go:146: 2025-02-27T07:57:18.656Z	INFO	grpc	[[transport] [client-transport 0xc0025f2248] Closing: rpc error: code = Canceled desc = grpc: the client connection is closing]
    logger.go:146: 2025-02-27T07:57:18.656Z	INFO	grpc	[[transport] [client-transport 0xc0025f2248] loopyWriter exiting with error: rpc error: code = Canceled desc = grpc: the client connection is closing]
    logger.go:146: 2025-02-27T07:57:18.656Z	INFO	grpc	[[transport] [server-transport 0xc000b56ea0] Closing: EOF]

=========================== compaction ==============
    logger.go:146: 2025-02-27T07:57:18.656Z	INFO	m0	finished scheduled compaction	{"member": "m0", "compact-revision": 2488, "took": "129.590742ms", "hash": 2489925777, "current-db-size-bytes": 40960, "current-db-size": "41 kB", "current-db-size-in-use-bytes": 40960, "current-db-size-in-use": "41 kB"}
=====================================================
```

Fixes: etcd-io#19497

Signed-off-by: Wei Fu <[email protected]>
@k8s-ci-robot
Copy link

Hi @k8s-infra-cherrypick-robot. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ahrtr
Copy link
Member

ahrtr commented Mar 5, 2025

/ok-to-test

@codecov
Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.92%. Comparing base (7850ff5) to head (54f2635).
Report is 5 commits behind head on release-3.6.

Additional details and impacted files

see 24 files with indirect coverage changes

@@               Coverage Diff               @@
##           release-3.6   #19541      +/-   ##
===============================================
- Coverage        68.95%   68.92%   -0.03%     
===============================================
  Files              420      420              
  Lines            35788    35788              
===============================================
- Hits             24677    24668       -9     
- Misses            9686     9693       +7     
- Partials          1425     1427       +2     

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 7850ff5...54f2635. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ahrtr
Copy link
Member

ahrtr commented Mar 5, 2025

/retest

Copy link
Member

@ivanvc ivanvc left a comment

Choose a reason for hiding this comment

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

LGTM.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, ivanvc, k8s-infra-cherrypick-robot

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

@ahrtr ahrtr merged commit 90f607a into etcd-io:release-3.6 Mar 6, 2025
39 checks passed
@ivanvc ivanvc mentioned this pull request Mar 24, 2025
1 task
@ivanvc ivanvc mentioned this pull request May 28, 2025
4 tasks
@ivanvc ivanvc mentioned this pull request Jul 6, 2025
2 tasks
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.

5 participants