Skip to content

[DO NOT MERGE] Find etcd hang - #6542

Closed
deads2k wants to merge 13 commits into
openshift:masterfrom
deads2k:find-etcd-hang
Closed

deads2k wants to merge 13 commits into
openshift:masterfrom
deads2k:find-etcd-hang

Conversation

@deads2k

@deads2k deads2k commented Jan 5, 2016

Copy link
Copy Markdown
Contributor

[test]

@deads2k
deads2k force-pushed the find-etcd-hang branch 2 times, most recently from 748311c to 3caae2b Compare January 5, 2016 20:26
@deads2k

deads2k commented Jan 6, 2016

Copy link
Copy Markdown
Contributor Author

@danmcp /data/src/github.com/openshift/origin/hack/../hack/util.sh: line 28: openshift: command not found https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/8213/console

In case you're still chasing it.

@deads2k

deads2k commented Jan 6, 2016

Copy link
Copy Markdown
Contributor Author

@danmcp another infrastructure one I've not seen before:

Warning: Permanently added '52.90.123.233' (ECDSA) to the list of known hosts.
remote: error: unable to create temporary file: File exists        
remote: fatal: failed to write object        
error: unpack failed: unpack-objects abnormal exit
To verifier:/data/src/github.com/openshift/origin-bare

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/8211/console

@deads2k

deads2k commented Jan 7, 2016

Copy link
Copy Markdown
Contributor Author

This https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/8235/artifact/origin/artifacts/e2e/logs/container-origin.log indicates that sometimes we recover (pop the value of the channel for the request) in 10 seconds and sometimes we don't. However, when we recover, it happens all at once.

2016-01-06 20:44:40.105954 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676851670
2016-01-06 20:44:44.886962 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676851686
2016-01-06 20:44:45.261729 I | etcdserver: #### Eventual success! for 9822940875676851670
2016-01-06 20:44:45.262195 I | etcdserver: #### Eventual success! for 9822940875676851686
2016-01-06 20:44:54.994505 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676851929
2016-01-06 20:45:02.015316 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676851953
2016-01-06 20:45:04.650957 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676851971
2016-01-06 20:45:04.994731 I | etcdserver: #### STILL TIMED OUT! for 9822940875676851929
2016-01-06 20:45:11.021531 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676851979
2016-01-06 20:45:12.015480 I | etcdserver: #### STILL TIMED OUT! for 9822940875676851953
2016-01-06 20:45:14.651166 I | etcdserver: #### STILL TIMED OUT! for 9822940875676851971
2016-01-06 20:45:18.041536 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676852019
2016-01-06 20:45:20.677742 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676852057
2016-01-06 20:45:21.021746 I | etcdserver: #### STILL TIMED OUT! for 9822940875676851979
2016-01-06 20:45:23.298727 I | etcdserver: #### Eventual success! for 9822940875676852019
2016-01-06 20:45:23.298831 I | etcdserver: #### Eventual success! for 9822940875676852057
2016-01-06 20:45:55.927170 I | etcdserver: #### FAILED ON TIMEOUT! for 9822940875676853543
2016-01-06 20:46:02.492942 I | etcdserver: #### Eventual success! for 9822940875676853543

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

@danmcp Not all logs are showing up in the jenkin's artifact view. When e2e runs, it creates a container called "origin". The log collection should be gathering it like this: https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/8292/artifact/origin/artifacts/e2e/logs/ . Instead, I have a lot of runs where it is missing like this: https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/8305/artifact/origin/artifacts/e2e/logs/ .

Where can I find the settings that do the artifact collection? I'll add debugging to the container log dumping script too, but I know we've had trouble with collection in general.

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

When things go badly, we slow down in this branch of this method. I've added tracing to try to tighten the ranges. Its not apply.

https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/server.go#L434-L486

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

@liggitt

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

We're stuck somewhere in these lines: https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/raft.go#L158-L171 because server.go isn't writing to the channel and gets blocks writing to done

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

@bparees

bparees commented Jan 8, 2016

Copy link
Copy Markdown
Contributor

@danmcp this comment is a lie:
#6542 (comment)

the job it lists actually failed (because i was updating the vagrant plugin)

@bparees

bparees commented Jan 8, 2016

Copy link
Copy Markdown
Contributor

@deads2k you're going to want to re-test this PR, but i don't want to touch things until @danmcp can take a look at why it marked the test as successful.

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

@deads2k you're going to want to re-test this PR, but i don't want to touch things until @danmcp can take a look at why it marked the test as successful.

@bparees I'm manually kicking jobs. That really confuses the comments in this pull.

@bparees

bparees commented Jan 8, 2016

Copy link
Copy Markdown
Contributor

@deads2k ah, ok.

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

Alright, we've gotten it narrowed down to this line: https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/coreos/etcd/wal/wal.go#L392. Sometimes (in this run, once per 600 calls) it takes about 4000 times longer than normal. Instead of 9 milliseconds, it takes 35 seconds. There are other less severe "pauses" in the log on this line too.

Based on other logging in the file, we're never writing more than 1 meg at a time, so that sort of pause is crazy.

At this point, I'm stuck. I don't understand why the write characteristics would change so dramatically.

@liggitt @danmcp @smarterclayton @vbatts I don't know what to do next.

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/8360/artifact/origin/artifacts/e2e/logs/container-origin.log

I0108 18:12:44.991885   16029 tracker.go:103] #### InspectionPoint wal.sync.sync.635 (<nil>) took 34.416856046 seconds instead of about 0.009141104 from
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/tracker.go:79 (0x1889d31)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/wal.go:399 (0x188e59a)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/wal.go:542 (0x188fba9)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/raft.go:186 (0x11dadd0)
/usr/lib/golang/src/runtime/asm_amd64.s:2232 (0x440441)

I0108 18:12:44.991984   16029 tracker.go:103] #### InspectionPoint wal.save.sync.634 (writing 2 entries for term=2, vote=1231859792466236092, commit=719, size=15) took 34.417077631 seconds instead of about 0.009247741 from
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/tracker.go:79 (0x1889d31)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/wal.go:540 (0x188f897)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/raft.go:186 (0x11dadd0)
/usr/lib/golang/src/runtime/asm_amd64.s:2232 (0x440441)

I0108 18:12:44.992048   16029 tracker.go:103] #### InspectionPoint raft.save.634 (writing 2 entries for term=2, vote=1231859792466236092, commit=719, size=15) took 34.417375708 seconds instead of about 0.009686583 from
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/tracker.go:79 (0x11ec3f1)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/raft.go:183 (0x11daa24)
/usr/lib/golang/src/runtime/asm_amd64.s:2232 (0x440441)

@smarterclayton

Copy link
Copy Markdown
Contributor

Kind of sounds like underlying filesystem iops starvation. @twiest can you
tell us how to figure out what IOP starvation looks like on EC2 to ensure
that's not the case?

Is a snapshot running?

On Fri, Jan 8, 2016 at 1:47 PM, David Eads [email protected] wrote:

Alright, we've gotten it narrowed down to this line:
https://github.com/openshift/origin/blob/master/Godeps/_workspace/src/github.com/coreos/etcd/wal/wal.go#L392.
Sometimes (in this run, once per 600 calls) it takes about 4000 times
longer than normal. Instead of 9 milliseconds, it takes 35 seconds. There
are other less severe "pauses" in the log on this line too.

Based on other logging in the file, we're never writing more than 1 meg at
a time, so that sort of pause is crazy.

At this point, I'm stuck. I don't understand why the write characteristics
would change so dramatically.

@liggitt https://github.com/liggitt @danmcp https://github.com/danmcp
@smarterclayton https://github.com/smarterclayton @vbatts
https://github.com/vbatts I don't know what to do next.

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/8360/artifact/origin/artifacts/e2e/logs/container-origin.log

I0108 18:12:44.991885 16029 tracker.go:103] #### InspectionPoint wal.sync.sync.635 () took 34.416856046 seconds instead of about 0.009141104 from
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/tracker.go:79 (0x1889d31)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/wal.go:399 (0x188e59a)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/wal.go:542 (0x188fba9)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/raft.go:186 (0x11dadd0)
/usr/lib/golang/src/runtime/asm_amd64.s:2232 (0x440441)

I0108 18:12:44.991984 16029 tracker.go:103] #### InspectionPoint wal.save.sync.634 (writing 2 entries for term=2, vote=1231859792466236092, commit=719, size=15) took 34.417077631 seconds instead of about 0.009247741 from
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/tracker.go:79 (0x1889d31)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/wal/wal.go:540 (0x188f897)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/raft.go:186 (0x11dadd0)
/usr/lib/golang/src/runtime/asm_amd64.s:2232 (0x440441)

I0108 18:12:44.992048 16029 tracker.go:103] #### InspectionPoint raft.save.634 (writing 2 entries for term=2, vote=1231859792466236092, commit=719, size=15) took 34.417375708 seconds instead of about 0.009686583 from
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/tracker.go:79 (0x11ec3f1)
/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/coreos/etcd/etcdserver/raft.go:183 (0x11daa24)
/usr/lib/golang/src/runtime/asm_amd64.s:2232 (0x440441)

—
Reply to this email directly or view it on GitHub
#6542 (comment).

@deads2k

deads2k commented Jan 8, 2016

Copy link
Copy Markdown
Contributor Author

Is a snapshot running?

I don't think so.

[deads@deads-dev-01 origin]$ grep "snapshot" container-origin.log.6
2016-01-08 18:10:11.756646 I | etcdserver: snapshot count = 0
2016-01-08 18:10:11.766865 I | etcdserver: set snapshot count to default 10000

@liggitt

liggitt commented Jan 8, 2016

Copy link
Copy Markdown
Contributor

Is a snapshot running?

No, happens well separated from snapshots (I've seen it around etcd index 7500, for example)

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2016
@twiest

twiest commented Jan 14, 2016

Copy link
Copy Markdown

Kind of sounds like underlying filesystem iops starvation. @twiest can you
tell us how to figure out what IOP starvation looks like on EC2 to ensure
that's not the case?

What we do is we use iostat -x /dev/vol 1 and we look at the %util. If it's at 100%, then all iops are being utilized.

You can also double check that with iostat /dev/vol 1 and look at the TPS and compare that to the number you expect. It will be around the total number of iops, but probably not exactly it.

@deads2k

deads2k commented Jan 14, 2016

Copy link
Copy Markdown
Contributor Author

What we do is we use iostat -x /dev/vol 1 and we look at the %util. If it's at 100%, then all iops are being utilized

@stevekuznetsov plan on this as a follow-up to the SAR stats.

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2016
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2016
@deads2k

deads2k commented Jan 18, 2016

Copy link
Copy Markdown
Contributor Author

Testing an insane theory; this is the last one I've got. What if we're not assigned our entire local disk upon the ec2 image provision? What if sometimes the backing storage isn't ready and they silently increase our allocation? It would probably be invisible in most circumstances, but a sync would mean "wait for guarantee of persistence" that they respect and causes etcd to wait.

This would explain why after cleaning up, we can't reproduce the problem. It would explain why it happens at about the same spot every time. It would explain why we hit this condition with very few iops. The only problem is that its a pretty crazy theory. I've added a dd to allocate and then remove a large file to try to reserve the space.

@deads2k

deads2k commented Jan 19, 2016

Copy link
Copy Markdown
Contributor Author

@liggitt Tremendous improvement. No more problems in test-integration or test-cmd. Some problems in test-e2e, but all of it below the 5 second timeout threshold. Looks like I have my tomorrow work.

@pweil- @danmcp If this works in the actual queue, I'm pretty sure this it's worth "immunity to all flakes for the next release" :)

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to bbd677b

@openshift-bot

Copy link
Copy Markdown
Contributor

@openshift-bot

Copy link
Copy Markdown
Contributor

Origin Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again

@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 20, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 29, 2016
@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 5, 2016
@deads2k

deads2k commented Feb 9, 2016

Copy link
Copy Markdown
Contributor Author

BEST FLAKE EVER!

@deads2k deads2k closed this Feb 9, 2016
@smarterclayton

Copy link
Copy Markdown
Contributor

I think this just happened again for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants