pass error up if WALWathcer.segments() return err (#5741)

Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>
This commit is contained in:
Yao Zengzeng 2019-07-16 00:52:03 +08:00 committed by Tom Wilkie
parent abdcbda82a
commit 3cde8a9941

View file

@ -234,7 +234,7 @@ func (w *WALWatcher) run() error {
func (w *WALWatcher) findSegmentForIndex(index int) (int, error) {
refs, err := w.segments(w.walDir)
if err != nil {
return -1, nil
return -1, err
}
for _, r := range refs {
@ -249,7 +249,7 @@ func (w *WALWatcher) findSegmentForIndex(index int) (int, error) {
func (w *WALWatcher) firstAndLast() (int, int, error) {
refs, err := w.segments(w.walDir)
if err != nil {
return -1, -1, nil
return -1, -1, err
}
if len(refs) == 0 {