aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-09-07 12:44:51 -0700
committerChris Lu <chris.lu@gmail.com>2020-09-07 12:44:51 -0700
commit44b3f2efc8e900db7256c2f2cf755fd2b4159aa2 (patch)
tree01479d67ceabc50dc8759e775bab9b2f9d6f6c8d
parentd80538a18744d20943fc42f315a14cb76b76961a (diff)
downloadseaweedfs-44b3f2efc8e900db7256c2f2cf755fd2b4159aa2.tar.xz
seaweedfs-44b3f2efc8e900db7256c2f2cf755fd2b4159aa2.zip
filer: Elastic Search return correct kv error
fix https://github.com/chrislusf/seaweedfs/issues/1452
-rw-r--r--weed/filer/elastic/v7/elastic_store_kv.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/filer/elastic/v7/elastic_store_kv.go b/weed/filer/elastic/v7/elastic_store_kv.go
index cfb3fdf8c..1b26bdf8e 100644
--- a/weed/filer/elastic/v7/elastic_store_kv.go
+++ b/weed/filer/elastic/v7/elastic_store_kv.go
@@ -3,9 +3,9 @@ package elastic
import (
"context"
"fmt"
+ "github.com/chrislusf/seaweedfs/weed/filer"
"github.com/chrislusf/seaweedfs/weed/glog"
- "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
jsoniter "github.com/json-iterator/go"
elastic "github.com/olivere/elastic/v7"
)
@@ -32,7 +32,7 @@ func (store *ElasticStore) KvGet(ctx context.Context, key []byte) (value []byte,
Id(string(key)).
Do(ctx)
if elastic.IsNotFound(err) {
- return nil, filer_pb.ErrNotFound
+ return nil, filer.ErrKvNotFound
}
if searchResult != nil && searchResult.Found {
esEntry := &ESKVEntry{}
@@ -41,7 +41,7 @@ func (store *ElasticStore) KvGet(ctx context.Context, key []byte) (value []byte,
}
}
glog.Errorf("find key(%s),%v.", string(key), err)
- return nil, filer_pb.ErrNotFound
+ return nil, filer.ErrKvNotFound
}
func (store *ElasticStore) KvPut(ctx context.Context, key []byte, value []byte) (err error) {