From 57fc03258e9ab6507ed01525b061080ff759cdd9 Mon Sep 17 00:00:00 2001 From: Steve Yen Date: Thu, 8 Feb 2018 14:32:55 -0800 Subject: [PATCH] scorch rollback ignores unsafeBatch flag See also: https://github.com/blevesearch/bleve/issues/760 --- index/scorch/snapshot_rollback.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/index/scorch/snapshot_rollback.go b/index/scorch/snapshot_rollback.go index c265b4c3..24700331 100644 --- a/index/scorch/snapshot_rollback.go +++ b/index/scorch/snapshot_rollback.go @@ -149,10 +149,7 @@ func (s *Scorch) Rollback(to *RollbackPoint) error { revert.snapshot = indexSnapshot revert.applied = make(chan error) - - if !s.unsafeBatch { - revert.persisted = make(chan error) - } + revert.persisted = make(chan error) return nil }) @@ -172,9 +169,5 @@ func (s *Scorch) Rollback(to *RollbackPoint) error { return fmt.Errorf("Rollback: failed with err: %v", err) } - if revert.persisted != nil { - err = <-revert.persisted - } - - return err + return <-revert.persisted }