未验证 提交 714b777d 编写于 作者: G groot 提交者: GitHub

#2642 Create index failed caused by server crashed. (#2701)

* #2642 Create index failed caused by server crashed.
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* changelog
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* changelog
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>

* typo
Signed-off-by: Nyhmo <yihua.mo@zilliz.com>
上级 36db2f4d
...@@ -6,13 +6,14 @@ Please mark all change in change log and use the issue from GitHub ...@@ -6,13 +6,14 @@ Please mark all change in change log and use the issue from GitHub
## Bug ## Bug
- \#2487 Enlarge timeout value for creating collection - \#2487 Enlarge timeout value for creating collection
- \#2585 IVF_PQ on GPU with using metric_type IP - \#2557 Fix random crash of INSERT_DUPLICATE_ID case
- \#2578 Result count doesn't match target vectors count - \#2578 Result count doesn't match target vectors count
- \#2557 fix random crash of INSERT_DUPLICATE_ID case - \#2585 IVF_PQ on GPU with using metric_type IP
- \#2598 fix Milvus docker image report illegal instruction - \#2598 Fix Milvus docker image report illegal instruction
- \#2617 Fix HNSW and RNSG index files size - \#2617 Fix HNSW and RNSG index files size
- \#2637 Suit the range of HNSW parameters - \#2637 Suit the range of HNSW parameters
- \#2649 search parameter of annoy has conflict with document - \#2642 Create index failed and server crashed
- \#2649 Search parameter of annoy has conflict with document
## Feature ## Feature
......
...@@ -112,6 +112,22 @@ BinaryIDMAP::QueryById(const DatasetPtr& dataset_ptr, const Config& config) { ...@@ -112,6 +112,22 @@ BinaryIDMAP::QueryById(const DatasetPtr& dataset_ptr, const Config& config) {
} }
#endif #endif
int64_t
BinaryIDMAP::Count() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->ntotal;
}
int64_t
BinaryIDMAP::Dim() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->d;
}
void void
BinaryIDMAP::Add(const DatasetPtr& dataset_ptr, const Config& config) { BinaryIDMAP::Add(const DatasetPtr& dataset_ptr, const Config& config) {
if (!index_) { if (!index_) {
......
...@@ -56,14 +56,10 @@ class BinaryIDMAP : public VecIndex, public FaissBaseBinaryIndex { ...@@ -56,14 +56,10 @@ class BinaryIDMAP : public VecIndex, public FaissBaseBinaryIndex {
#endif #endif
int64_t int64_t
Count() override { Count() override;
return index_->ntotal;
}
int64_t int64_t
Dim() override { Dim() override;
return index_->d;
}
int64_t int64_t
IndexSize() override { IndexSize() override {
......
...@@ -129,6 +129,22 @@ BinaryIVF::QueryById(const DatasetPtr& dataset_ptr, const Config& config) { ...@@ -129,6 +129,22 @@ BinaryIVF::QueryById(const DatasetPtr& dataset_ptr, const Config& config) {
} }
#endif #endif
int64_t
BinaryIVF::Count() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->ntotal;
}
int64_t
BinaryIVF::Dim() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->d;
}
void void
BinaryIVF::Train(const DatasetPtr& dataset_ptr, const Config& config) { BinaryIVF::Train(const DatasetPtr& dataset_ptr, const Config& config) {
GETTENSORWITHIDS(dataset_ptr) GETTENSORWITHIDS(dataset_ptr)
......
...@@ -68,14 +68,10 @@ class BinaryIVF : public VecIndex, public FaissBaseBinaryIndex { ...@@ -68,14 +68,10 @@ class BinaryIVF : public VecIndex, public FaissBaseBinaryIndex {
#endif #endif
int64_t int64_t
Count() override { Count() override;
return index_->ntotal;
}
int64_t int64_t
Dim() override { Dim() override;
return index_->d;
}
#if 0 #if 0
DatasetPtr DatasetPtr
......
...@@ -142,6 +142,22 @@ IDMAP::QueryById(const DatasetPtr& dataset_ptr, const Config& config) { ...@@ -142,6 +142,22 @@ IDMAP::QueryById(const DatasetPtr& dataset_ptr, const Config& config) {
} }
#endif #endif
int64_t
IDMAP::Count() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->ntotal;
}
int64_t
IDMAP::Dim() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->d;
}
VecIndexPtr VecIndexPtr
IDMAP::CopyCpuToGpu(const int64_t device_id, const Config& config) { IDMAP::CopyCpuToGpu(const int64_t device_id, const Config& config) {
#ifdef MILVUS_GPU_VERSION #ifdef MILVUS_GPU_VERSION
......
...@@ -54,14 +54,10 @@ class IDMAP : public VecIndex, public FaissBaseIndex { ...@@ -54,14 +54,10 @@ class IDMAP : public VecIndex, public FaissBaseIndex {
#endif #endif
int64_t int64_t
Count() override { Count() override;
return index_->ntotal;
}
int64_t int64_t
Dim() override { Dim() override;
return index_->d;
}
int64_t int64_t
IndexSize() override { IndexSize() override {
......
...@@ -217,6 +217,22 @@ IVF::GetVectorById(const DatasetPtr& dataset_ptr, const Config& config) { ...@@ -217,6 +217,22 @@ IVF::GetVectorById(const DatasetPtr& dataset_ptr, const Config& config) {
} }
#endif #endif
int64_t
IVF::Count() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->ntotal;
}
int64_t
IVF::Dim() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->d;
}
void void
IVF::Seal() { IVF::Seal() {
if (!index_ || !index_->is_trained) { if (!index_ || !index_->is_trained) {
......
...@@ -59,14 +59,10 @@ class IVF : public VecIndex, public FaissBaseIndex { ...@@ -59,14 +59,10 @@ class IVF : public VecIndex, public FaissBaseIndex {
#endif #endif
int64_t int64_t
Count() override { Count() override;
return index_->ntotal;
}
int64_t int64_t
Dim() override { Dim() override;
return index_->d;
}
#if 0 #if 0
DatasetPtr DatasetPtr
......
...@@ -149,11 +149,17 @@ NSG::Train(const DatasetPtr& dataset_ptr, const Config& config) { ...@@ -149,11 +149,17 @@ NSG::Train(const DatasetPtr& dataset_ptr, const Config& config) {
int64_t int64_t
NSG::Count() { NSG::Count() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->ntotal; return index_->ntotal;
} }
int64_t int64_t
NSG::Dim() { NSG::Dim() {
if (!index_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_->dimension; return index_->dimension;
} }
......
...@@ -200,11 +200,17 @@ CPUSPTAGRNG::Query(const DatasetPtr& dataset_ptr, const Config& config) { ...@@ -200,11 +200,17 @@ CPUSPTAGRNG::Query(const DatasetPtr& dataset_ptr, const Config& config) {
int64_t int64_t
CPUSPTAGRNG::Count() { CPUSPTAGRNG::Count() {
if (!index_ptr_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_ptr_->GetNumSamples(); return index_ptr_->GetNumSamples();
} }
int64_t int64_t
CPUSPTAGRNG::Dim() { CPUSPTAGRNG::Dim() {
if (!index_ptr_) {
KNOWHERE_THROW_MSG("index not initialize");
}
return index_ptr_->GetFeatureDim(); return index_ptr_->GetFeatureDim();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册