188 Commits

Author SHA1 Message Date
Gyu-Ho Lee
c76df5052b *: update proto to add 'prev_kv' 2016-10-07 10:47:47 -07:00
Gyu-Ho Lee
023f335f67 wal: set PageWriter offset in file encoder 2016-10-04 15:12:47 -07:00
Gyu-Ho Lee
fe3a1cc31b wal: fix error type 2016-09-09 09:11:25 +09:00
Gyu-Ho Lee
70713706a1 wal: fix err shadowing (go vet) 2016-09-09 09:07:48 +09:00
Anthony Romano
202da9270e wal: fsync directory after wal file rename
Fixes #6368
2016-09-09 09:01:49 +09:00
Gyu-Ho Lee
183293e061 wal: lowercase segmentSizeBytes 2016-08-31 09:48:30 -07:00
Aaron Lehmann
5089bf58fb 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-31 09:39:57 -07:00
Anthony Romano
480a347179 wal: use page buffered writer for writing records
Forces torn writes to only happen on sector boundaries.

Fixes #6271
2016-08-30 21:06:36 -07:00
Anthony Romano
bd7581ac59 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-26 14:27:53 -07:00
Anthony Romano
db378c3d26 wal: test for truncation on torn writes 2016-08-26 14:27:51 -07:00
Gyu-Ho Lee
602198105d *: regenerate proto 2016-07-18 11:08:51 -07:00
Anthony Romano
ef65dfe2eb wal: release wal locks before renaming directory on init
Fixes #5852
2016-07-05 11:05:51 -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