Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/server/milvus_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,28 @@ Status MilvusServiceImpl::GetLoadState(grpc::ServerContext *, const pb_milvus::G

Status MilvusServiceImpl::Flush(grpc::ServerContext *, const pb_milvus::FlushRequest *req,
pb_milvus::FlushResponse *resp) {
for (const auto &name : req->collection_names()) store_->flush(name);
for (const auto &name : req->collection_names()) {
store_->flush(name);
// Flush is synchronous; these fields only exist so pymilvus can poll
// GetFlushState without failing.
(*resp->mutable_coll_segids())[name];
(*resp->mutable_flush_coll_segids())[name];
(*resp->mutable_coll_flush_ts())[name] = 1;
}
*resp->mutable_status() = ok_status();
return Status::OK;
}

Status MilvusServiceImpl::GetFlushState(grpc::ServerContext *, const pb_milvus::GetFlushStateRequest *req,
pb_milvus::GetFlushStateResponse *resp) {
if (!req->collection_name().empty() && !store_->has_collection(req->collection_name())) {
*resp->mutable_status() = err_status("collection not found");
return Status::OK;
}
*resp->mutable_status() = ok_status();
// Flush completes before the RPC returns, so any follow-up state check is
// immediately satisfied.
resp->set_flushed(true);
return Status::OK;
}

Expand Down
2 changes: 2 additions & 0 deletions src/server/milvus_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class MilvusServiceImpl final : public pb_milvus::MilvusService::Service {
pb_milvus::GetLoadingProgressResponse *resp) override;
grpc::Status Flush(grpc::ServerContext *ctx, const pb_milvus::FlushRequest *req,
pb_milvus::FlushResponse *resp) override;
grpc::Status GetFlushState(grpc::ServerContext *ctx, const pb_milvus::GetFlushStateRequest *req,
pb_milvus::GetFlushStateResponse *resp) override;

// Partitions. PipeANN has no partition concept (partition-scoped filtering is
// handled through the attribute filter path), so these are compatibility
Expand Down
Loading