Commit Graph

15158 Commits (96a7ff0a62ce3f52aad258289bd0f25d1a781a1b)

Author SHA1 Message Date
James Shubin 368f70a37c etcdserver: Use panic instead of fatal on no space left error
When using the embed package to embed etcd, sometimes the storage prefix
being used might be full. In this case, this code path triggers, causing
an: `etcdserver: create wal error: no space left on device` error, which
causes a fatal. A fatal differs from a panic in that it also calls
os.Exit(1). In this situation, the calling program that embeds the etcd
server will be abruptly killed, which prevents it from cleaning up
safely, and giving a proper error message. Depending on what the calling
program is, this can cause corruption and data loss.

This patch switches the fatal to a panic. Ideally this would be a
regular error which would get propagated upwards to the StartEtcd
command, but in the meantime at least this can be caught with recover().

This fixes the most common fatal that I've experienced, but there are
surely more that need looking into. If possible, the errors should be
threaded down into the code path so that embedding etcd can be more
robust.

Fixes: https://github.com/etcd-io/etcd/issues/10588
2019-03-27 15:24:33 -04:00
Sahdev Zala 9c2b88d783
Merge pull request #10583 from johncming/correct_err
etcdmain: use same error.
2019-03-26 15:03:38 -04:00
Sahdev P. Zala 56f1bce161 raft/doc: clarify the case of out of date term
Clarify the doc.

Fixes #10491
2019-03-26 14:00:24 -04:00
johncming 11272ed320 etcdmain: use same error. 2019-03-26 11:21:47 +08:00
johncming cb39c97b22 clientv3/naming: ignore empty update. 2019-03-25 10:53:24 +08:00
Xiang Li 7a5acb4a43
Merge pull request #10574 from johncming/rename_err
raft: more precise that rename res to err.
2019-03-22 11:35:51 -07:00
caoming 92d5d19ce9 raft: more precise that rename res to err. 2019-03-22 10:18:00 +08:00
mengjin 41f7142ff9 doc: fix document example error 2019-03-21 08:21:03 -04:00
Sam Batschelet 122744c660 Documentation: update force-new-cluster flag usage for v3
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2019-03-20 18:06:42 -04:00
Xiang Li 77d4b742cd
Merge pull request #10562 from johncming/naked_return
contrib/raftexample: fix naked return.
2019-03-19 21:43:26 -07:00
Jingyi Hu affaa36190 bill-of-materials: fix test failure
Re-generated bill-of-materials.json.
2019-03-19 22:07:00 -04:00
johncming 4452d4be22 contrib/raftexample: fix naked return. 2019-03-20 09:52:12 +08:00
Xiang Li 09d0844379
Merge pull request #10548 from jingyih/add_TestMemberAddWithExistingURLs
clientv3/integration: Add TestMemberAddWithExistingURLs
2019-03-19 15:23:15 -07:00
Xiang Li 2d9b32dc3d
Merge pull request #10542 from johncming/usecancel
integration: use cancel instead of close.
2019-03-19 14:19:32 -07:00
Xiang Li ec1cbce10e
Merge pull request #10541 from johncming/embed-comment
embed: Modify the comments to be more precise.
2019-03-19 14:18:44 -07:00
Xiang Li 6df40e1c70
Merge pull request #10550 from johncming/unused
clientv3: clean up unused code.
2019-03-19 14:17:41 -07:00
Xiang Li b1e8218072
Merge pull request #10553 from damnever/damnever-patch-1
doc: fix `member add` usage
2019-03-18 20:47:55 -07:00
johncming 51cdbb6d1a contrib/raftexample: add test for struct httpKVAPI. 2019-03-19 11:12:47 +08:00
Jingyi Hu 9bd86a647f clientv3: Add TestMemberAddWithExistingURLs
TestMemberAddWithExistingURLs ensures adding a new member with URLs
already being used in the cluster will not succeed.
2019-03-18 12:48:44 -07:00
X.C.Dong 1d764511f6
doc: fix `member add` usage 2019-03-18 14:47:41 +08:00
johncming ddff08ffad clientv3/balancer: change balancer name to builder name. 2019-03-18 11:05:22 +08:00
johncming 662fd55084 clientv3: clean up unused code. 2019-03-18 10:34:41 +08:00
caoming 97509833e2 integration: use cancel instead of close. 2019-03-14 11:14:43 +08:00
caoming 874532c2da embed: Modify the comments to be more precise. 2019-03-14 10:59:52 +08:00
Xiang Li e1ca3b4434
Merge pull request #10531 from JoeWrightss/patch-3
Fix some variable spelling errors
2019-03-12 12:09:09 -07:00
Xiang Li 4478993fbc
Merge pull request #10516 from shreyas-s-rao/wal-verify-func
wal: add Verify function to perform corruption check on wal contents
2019-03-12 12:06:36 -07:00
Shreyas Rao bb3eb8fea9 wal: Add test for Verify
Signed-off-by: Shreyas Rao <shreyas.sriganesh.rao@sap.com>
2019-03-12 22:25:25 +05:30
shreyas-s-rao 3d6862fe0d wal: add Verify function to perform corruption check on wal contents
Signed-off-by: Shreyas Rao <shreyas.sriganesh.rao@sap.com>
2019-03-12 22:25:25 +05:30
Xiang Li dc50416157
Merge pull request #10534 from johncming/close_reader
close http request body after read it.
2019-03-12 08:25:32 -07:00
johncming e46af034df bugfix: adjust or add close request body.
affected modules:
- lease/leasehttp
- contrib/raftexample
2019-03-12 22:41:55 +08:00
Xiang Li b7ad8c6741
Merge pull request #10535 from johncming/fix_close_pos
etcdserver/api/rafthttp: fix the location of close http body.
2019-03-11 09:17:13 -07:00
johncming bd41f74168 etcdserver/api/rafthttp: fix the location of close http body. 2019-03-11 22:20:38 +08:00
zhoulin xie 939b4f8599 clientv3/balancer/grpc1.7-health.go: Fix variable spelling error
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-03-10 01:11:02 +08:00
Xiang Li 6da17cda18
Merge pull request #10515 from Prototik/fix-sd-notify
etcdmain: fix sd_notify for restricted environments
2019-03-08 15:34:47 -08:00
Xiang Li 4dc9d8b058
Merge pull request #10503 from spzala/v3argorder10431
clientV3: fix behavior of WithPrefix and WithFromKey functions
2019-03-08 11:59:17 -08:00
Xiang Li e80d1745be
Merge pull request #10420 from spzala/watch10340
clientV3watch: do not return ctx canceled when Close watch
2019-03-08 11:57:44 -08:00
Gyuho Lee 81b71da66d
Merge pull request #10527 from etcd-io/gyuho-patch-1
docs: update PyYAML to 4.2b1
2019-03-07 11:17:20 -08:00
Gyuho Lee 5ed26c7c48
docs: update PyYAML to 4.2b1
https://github.com/etcd-io/etcd/network/alert/docs/requirements.txt/pyyaml/open
2019-03-07 11:14:10 -08:00
Xiang Li 949bcbddbe
Merge pull request #10526 from jingyih/improve_mvcc_index_concurrency
mvcc: release lock early when traversing index
2019-03-06 15:48:48 -08:00
Jingyi Hu 93732df3ef mvcc: release lock early when traversing index
Make a copy-on-write clone of index tree when traversing. So that lock
can be released right after the clone to improve backend concurrency.
2019-03-06 14:26:17 -08:00
Xiang Li 4b69cfc56b
Merge pull request #10492 from nolouch/fix-lessor
lease: fix deadlock with Renew lease when the checkpointor is set
2019-03-06 10:23:57 -08:00
Xiang Li b08e6db0e8
Merge pull request #10506 from jingyih/improve_etcd_backend_readability
mvcc/backend: rename Lock() to RLock() in ReadTx interface
2019-03-05 14:54:04 -08:00
Jingyi Hu 1c19f126cb mvcc/backend: rename ReadTx Lock() to RLock()
For better code readability, renaming Lock() to RLock() in ReadTx
interface.
2019-03-05 13:53:27 -08:00
Sergey Shatunov fbf732d3dc
etcdmain: fix sd_notify for restricted environments
Remove call to dumb IsRunningSystemd() as it doesn't check anything
2019-03-02 23:44:39 +07:00
Xiang Li 2c69559819
Merge pull request #10513 from jutley/txn-newline-documentation
etcdctl: Update README to clarify newline syntax in TXN
2019-03-02 15:23:31 +08:00
Jake Utley a532b60c7e
etcdctl: Update README to clarify newline syntax in TXN
Add documentation to clarify that when writing TXN commands, multi-line values should be written using "\n" and not a literal newline (as in other commands).

Fixes #10169
2019-03-01 14:04:48 -08:00
Sahdev P. Zala b25edb62cc clientV3watch: Watch Close should close successfully
Closing of watch by client will cancel the watch grpc stream and
can produce a context canceled error. However, since client
simply wanted to close the watcher the error can create confusion
that something went wrong instead of a successful close. Ensure
that Close do not return error.

Fixed #10340
2019-02-28 20:43:20 -05:00
zhoulin xie a943ad0ee4 client/keys_bench_test.go: Fix some misspells
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-28 14:36:06 -05:00
Xiang Li 5694f3e4f5
Merge pull request #10481 from hnlq715/master
client: upgrade github.com/ugorji/go to v1.1.2
2019-02-28 21:15:33 +08:00
Sahdev P. Zala 8782bbae65 clientV3: fix behavior of WithPrefix and WithFromKey functions
The use of WithPrefix() and WithFromKey() together is not supported. The
client doesn't respect this behavior currently.

Fixes #10431
2019-02-27 09:23:01 -05:00