Anthony Romano
28277b5a65
wal: use page buffered writer for writing records
...
Forces torn writes to only happen on sector boundaries.
Fixes #6271
2016-08-30 15:49:07 -07:00
sharat
69ed560fae
wal: document grammar correction
...
Corrected grammar mistake for doc.go
2016-08-30 00:50:02 +05:30
Aaron Lehmann
af4f82228c
wal: hold file lock while renaming WAL directory on non-Windows
...
Windows requires this lock to be released before the directory is
renamed. But on unix-like operating systems, releasing the lock and
trying to reacquire it immediately can be flaky if a process is forked
around the same time. The file descriptors are marked as close-on-exec
by the Go runtime, but there is a window between the fork and exec where
another process will be holding the lock.
2016-08-26 09:27:51 -07:00
Anthony Romano
f1ead43482
wal: zero out wal tail past its first zero record
...
Whenever the WAL is opened for writes, it should write zeroes to its tail
starting from the first zero record. Otherwise, if there are entries past
the first zero record due to a torn write, any new writes that overlap the
old entries will lead to a garbage record on the tail and cause a CRC
mismatch.
2016-08-25 14:24:46 -07:00
Anthony Romano
0d8d9a374c
wal: test for truncation on torn writes
2016-08-25 14:24:46 -07:00
Aaron Lehmann
2b996b6038
wal: Export SegmentSizeBytes as a variable
...
In test situations, it's useful to create smaller than usual WAL files
to test rotation and to avoid the overhead of preallocation on old-style
filesystems that don't handle it efficiently. This commit changes
segmentSizeBytes to an exported variable so that tests can override it
from an init() function.
2016-08-09 15:38:30 -07:00
Gyu-Ho Lee
982e18d80b
*: regenerate proto with latest grpc-gateway
2016-07-27 13:21:03 -07:00
Xiang Li
fffa484a9f
*: regenerate proto for adding deleterange
2016-07-23 16:17:44 -07:00
Gyu-Ho Lee
50be793f09
*: regenerate proto
2016-07-18 09:33:32 -07:00
Anthony Romano
5991209c2d
wal: release wal locks before renaming directory on init
...
Fixes #5852
2016-07-02 12:14:37 -07:00
Gyu-Ho Lee
6cfc03a5f9
wal: use CreateDirAll
2016-06-22 15:57:55 -07:00
Xiang Li
5a7b7f7595
main: add grpc-gateway support
...
Now etcd can serve HTTP json request at /v3alpha/
2016-06-14 17:09:06 -07:00
Gyu-Ho Lee
b4aa4607cb
wal: use bytes.Equal, other minor updates
...
- Replace reflect.Equal with bytes.Equal where possible
- Remove some TODOs
- Some minor simplifications
2016-06-13 01:33:53 -07:00
Gyu-Ho Lee
3243795522
wal: simplify boolean return
2016-06-11 10:36:52 -07:00
Gyu-Ho Lee
4570eddc2c
wal: PrivateFileMode/DirMode as in pkg/fileutil
...
To make it consistent with pkg/fileutil
2016-06-10 15:20:57 -07:00
Anthony Romano
39eaa37dcf
wal: warn if sync exceeds a second
2016-06-08 11:03:18 -07:00
Gyu-Ho Lee
1610391449
*: following changes for proto update
2016-06-07 13:33:03 -07:00
Anthony Romano
7f461b2df9
Merge pull request #5572 from heyitsanthony/fallocate-eintr-fallback
...
pkg/fileutil: fall back to truncate() if fallocate is interrupted
2016-06-06 15:24:42 -07:00
Anthony Romano
5be39d2c84
wal: don't preallocate on old tail file
...
Code is only there to handle an edge case where the tail wasn't preallocated
already (e.g., via old etcd version or a crash). It also triggers tmpfs
corruption, so remove it.
2016-06-06 11:31:25 -07:00
Gyu-Ho Lee
008081ffb5
wal: minor fixes
...
- remove unnecessary type cast
- simply modulo operations
2016-06-06 09:43:19 -07:00
Anthony Romano
05cc3c3dbb
wal: limit number of tmp file names
...
This fixes a space leak if the etcd server is restarted in shorter and shorter
intervals causing the tmp files to stack up.
2016-05-31 06:25:23 -07:00
Anthony Romano
71a9d6fc8b
wal: don't warn when opening wal directory with stale tmp files
2016-05-31 06:25:23 -07:00
Gyu-Ho Lee
4a5befc2de
wal: update LICENSE header
2016-05-12 20:50:04 -07:00
Anthony Romano
17391336af
wal: atomically initialize wal directory
...
Fixes #5270
2016-05-11 16:50:17 -07:00
Xiang Li
0fb7cb8b00
*: add disk operation metrics for monitoring
2016-05-11 09:36:45 -07:00
Anthony Romano
cd9e6a1d4f
wal: lock WAL file while repairing
2016-05-06 16:57:55 -07:00
Anthony Romano
774030e1b2
wal: repair torn writes
...
Fixes #5230
2016-05-06 16:54:08 -07:00
Xiang Li
98031a3b6e
Merge pull request #5249 from xiang90/metrics
...
*: add metrics for grpc api
2016-05-05 14:19:46 -07:00
Xiang Li
063307ec0a
*: add metrics for grpc api
2016-05-05 13:45:52 -07:00
Gyu-Ho Lee
015acabdbb
*: rerun genproto -g
2016-05-02 23:02:31 -07:00
Xiang Li
67645095e9
*: add debugging metrics
2016-04-26 09:52:56 -07:00
Anthony Romano
b7ac758969
*: rename storage package to mvcc
2016-04-25 15:25:51 -07:00
Gyu-Ho Lee
4b31acf0e0
*: update generated Proto
2016-04-25 14:08:33 -07:00
Ajit Yagaty
8b6de5f85d
fileutil: Sync on HFS/OSX needs to be handled differently.
...
A call file.Sync on OSX doesn't guarantee actual persistence on
physical drive media as the data can be cached in physical drive's
buffers. Hence calls to file.Sync need to be replaced with
fcntl(F_FULLFSYNC).
2016-04-18 21:49:04 -07:00
Gyu-Ho Lee
641a1a66e1
*: fix govet -shadow in go tip
2016-04-15 07:39:52 -07:00
Gyu-Ho Lee
7a2ef3eb00
*: regenerate proto buffers
2016-04-13 16:24:07 -07:00
mqliang
1044fbce2c
etcdctlv3: update aunto generated files
2016-04-12 22:48:47 +08:00
Anthony Romano
dc17eaace7
*: rename Lease Create to Grant
...
Creating a lease through the client API interface union looked like
"c.Create(...)"-- the method name wasn't very descriptive.
2016-04-07 12:28:14 -07:00
Anthony Romano
bfe3a3d08e
wal: fix tail corruption
...
On ReadAll, WAL seeks to the end of the last record in the tail. If the tail did not
end with preallocated space, the decoder would report 0 as the last offset and begin
writing at offset 0 of the tail.
Fixes #4903
2016-04-01 15:05:52 -07:00
Anthony Romano
bd832e5b0a
*: migrate Godeps to vendor/
2016-03-22 17:10:28 -07:00
Anthony Romano
0df732c052
wal: pre-create segment files
...
Pipeline file creation and allocation so it overlaps writes to the log.
Fixes #4773
2016-03-21 11:56:53 -07:00
Anthony Romano
24b806d2ee
wal: preallocate WAL files with initial size equal to segment size
...
Avoids having to update file size metadata during fdatasync on common path.
Fixes #4755
2016-03-21 11:56:53 -07:00
Anthony Romano
aafe717f2f
fileutil: support file extending preallocate
2016-03-21 09:42:30 -07:00
Anthony Romano
7397e14c0a
fileutil, wal: refactor file locking
...
File lock interface was more verbose than it needed to be while
simultaneously making it difficult to support systems (e.g., Windows)
that only permit locked writes on a single fd holding the lock.
2016-03-16 15:02:15 -07:00
Xiang Li
53e7ddbc66
wal: do not call fsync when it is not necessary
2016-03-14 11:52:06 -07:00
Xiang Li
e59efe45a1
wal: support fadatasync on linux
2016-03-13 17:22:53 -07:00
Anthony Romano
20461ab11a
*: fix many typos
2016-01-31 21:42:39 -08:00
Gyu-Ho Lee
71c2a9bb3c
*: fix minor typos, comments
2016-01-30 18:15:56 -08:00
Gyu-Ho Lee
a35d5889f6
*: update gRPC, proto interface
2016-01-26 17:41:39 -08:00
Gyu-Ho Lee
a4de207d53
wal: fix shadowed variables
...
Fixes for https://github.com/coreos/etcd/issues/3954 .
2015-12-12 09:38:26 -08:00