Commit Graph

124 Commits

Author SHA1 Message Date
b66eb3d81c wal: fix ReleaseLockTo
ReleaseLockTo should not release the lock on the WAL
segment that is right before the given index. When
restarting etcd, etcd needs to read from the WAL segment
that has a smaller index than the snapshot index.

The correct behavior is that ReleaseLockTo releases
the locks w is holding so that w only holds one lock
that has an index smaller than the given index.
2015-03-09 19:52:54 -07:00
86429264fb wal: support auto-cut in wal
WAL should control the cut logic itself. We want to do falloc to
per allocate the space for a segmented wal file at the beginning
and cut it when it size reaches the limit.
2015-02-28 11:18:59 -08:00
84485643fe *: expose wal metrics at /metrics 2015-02-28 11:06:11 -08:00
fb1a28c65d *: vendor prometheus 2015-02-28 11:06:11 -08:00
9e63b1fb63 wal: record metrics 2015-02-28 10:12:35 -08:00
e966e565c4 etcdctl/backup_command: handle datadir with missed snapshot mark
This helps to recover from the data dir created in v2.0.0-rc1.
2015-01-29 13:32:59 -08:00
f1ed69e883 *: switch to line comments for copyright
Build tags are not compatible with block comments.
Also adds copyright header to a few places it was missing.
2015-01-26 09:53:30 -08:00
270e67db84 wal: not export unnecessary public functions 2015-01-09 14:55:10 -08:00
6460e49a33 wal: save empty snapshot when create
So caller can open at empty snapshot to read all entries.
2015-01-06 19:48:21 -08:00
84f62f21ee wal: record and check snapshot 2015-01-06 16:27:40 -08:00
1ec98cb795 pkg/fileutil: sort filenames during ReadDir 2014-12-18 16:36:11 -08:00
53bf7e4b5e wal: rename openAtIndex -> open; OpenAtIndexUntilUsing -> openNotInUse 2014-12-14 19:33:06 -08:00
f538cba272 *: do not backup files still in use 2014-12-14 19:27:22 -08:00
ea94d19147 *: lock the in using files; do not purge locked the wal files 2014-12-14 19:27:22 -08:00
b9bf957c6d wal: sync after writing data to disk in Cut function 2014-12-04 22:56:34 -08:00
af0f34c595 wal: save latest state into new WAL
So we could always read out state when open at valid index.
2014-12-04 12:19:21 -08:00
aa61009560 wal: not return ErrIndexNotFound in ReadAll
This IndexNotFound case is reasonable now because we don't write dummy
entries into wals any more.
2014-12-02 00:28:54 -08:00
d3db010190 *: support purging old wal/snap files 2014-12-01 11:50:17 -08:00
5a964f49a5 wal: propagate errors 2014-11-08 17:16:23 -08:00
075ab6415f Merge pull request #1587 from xiangli-cmu/fix_wal
wal: sync before returning from create
2014-11-03 15:58:47 -08:00
ff1f5a9d57 wal: sync before returning from create 2014-11-03 14:28:59 -08:00
433b4138c5 etcdserver: panic on storage error
It is a critical error to etcd, and etcd is not able to recover it now.
2014-11-03 10:46:04 -08:00
7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
f98fbbfc14 *: proto refactoring 2014-10-14 21:07:23 +08:00
447caf1afc etcdserver/wal: record info at the head of WAL file 2014-10-10 11:57:09 -07:00
8bbbaa88b2 *: raft related int64 -> uint64 2014-10-09 14:29:21 +08:00
1d5d2e3726 *: Id -> ID for protobuf types
We use ID instead of Id in this project based on golang conventions.
2014-09-26 11:49:30 -07:00
cf4af47f7e wal: remove logging messages
These are noisy and unhelpful by default. We can re-add if at some point
we reintroduce debugging/multiple log levels.
2014-09-22 19:08:47 -07:00
df70f653a4 Merge pull request #1099 from unihorn/128
wal: OpenFromIndex fails if it cannot find previous index
2014-09-17 16:00:51 -07:00
29f6d8a9e6 wal: add ErrFileNotFound and ErrIndexNotFound 2014-09-17 15:58:06 -07:00
7160b5ae26 wal: OpenFromIndex fails if it cannot find previous index
Example:
We save entry 1, 2, 3 to WAL.
If we try to open 100, it should fail.
2014-09-17 15:07:07 -07:00
ab61a8aa9a *: init for on disk snap support 2014-09-17 13:56:12 -07:00
de21c39ca5 raft: isStateEqual -> isHardStateEqual, IsEmptyState -> IsEmptyHardState 2014-09-16 13:55:00 -07:00
023dc7cba2 etcdserver: add SYNC request 2014-09-16 13:42:03 -07:00
69f2d5c590 wal: refactor 2014-09-15 10:35:36 -07:00
77fbd2610c wal: add comment 2014-09-15 10:17:21 -07:00
1d09c25f5f wal: add walName function; cleanup test 2014-09-15 10:17:21 -07:00
cec1956b8f wal: better comment 2014-09-15 10:14:18 -07:00
8e0ee1cc5e wal: remove wrong comment for cut 2014-09-15 10:14:18 -07:00
1164c4b83d wal: recover writting seq 2014-09-15 10:14:18 -07:00
21860bc017 wal: cut(i uint64) -> cut 2014-09-15 10:14:18 -07:00
140fd6d6c4 raft: restart using last written entry also 2014-09-15 09:56:33 -07:00
a9af70c52b raft: write entry 0 into log 2014-09-15 09:55:52 -07:00
2030ca202f wal: change wal filename format
Make raftIndex section to be expected raftIndex of next entry.

It makes filename more intuitive and straight-forward.

The commit also adds comments for filename format.
2014-09-12 11:24:28 -07:00
884c702512 wal: wal.OpenFromIndex -> wal.OpenAtIndex
The first entry read from the wal should be the index provided. This
name makes that more clear.
2014-09-11 12:52:06 -07:00
c251304068 *: s/Id/ID/
golang convention dictates that the individual characters in an
abbreviation should all have the same case. Use ID instead of Id.

The protobuf generator still generates code that does not meet
this convention, but that's a fight for another day.
2014-09-10 16:09:08 -07:00
90c0db3d42 wal: do not save empty state 2014-09-09 10:15:29 -07:00
54734b0903 main/wal: add a const for 0700 magic number 2014-09-08 15:45:58 -07:00
b094410066 wal: change entries->ents for consistency 2014-09-08 15:40:12 -07:00
adff0f3813 wal: named return values for ReadAll. 2014-09-08 15:36:25 -07:00