mirror of https://github.com/milvus-io/milvus.git
Fix an issue where query coord calls MinioChunkManager during init (#16629)
It causes Milvus not runnable with local storage. issue: #15604 /kind enhancement Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>pull/16620/head
parent
e66ac6a77c
commit
4ef2df8cb9
|
@ -190,13 +190,7 @@ func (qc *QueryCoord) Init() error {
|
|||
// we only try best to reload the leader addresses
|
||||
reloadShardLeaderAddress(qc.meta, qc.cluster)
|
||||
|
||||
qc.chunkManager, initError = storage.NewMinioChunkManager(qc.loopCtx,
|
||||
storage.Address(Params.MinioCfg.Address),
|
||||
storage.AccessKeyID(Params.MinioCfg.AccessKeyID),
|
||||
storage.SecretAccessKeyID(Params.MinioCfg.SecretAccessKey),
|
||||
storage.UseSSL(Params.MinioCfg.UseSSL),
|
||||
storage.BucketName(Params.MinioCfg.BucketName),
|
||||
storage.CreateBucket(true))
|
||||
qc.chunkManager, initError = qc.factory.NewVectorStorageChunkManager(qc.loopCtx)
|
||||
|
||||
if initError != nil {
|
||||
log.Error("query coordinator init cluster failed", zap.Error(initError))
|
||||
|
|
|
@ -55,14 +55,7 @@ func newQueryShardService(ctx context.Context, historical *historical, streaming
|
|||
enabled, _ := Params.Load("localStorage.enabled")
|
||||
localCacheEnabled, _ := strconv.ParseBool(enabled)
|
||||
localChunkManager := storage.NewLocalChunkManager(storage.RootPath(path))
|
||||
remoteChunkManager, _ := storage.NewMinioChunkManager(
|
||||
ctx,
|
||||
storage.Address(Params.MinioCfg.Address),
|
||||
storage.AccessKeyID(Params.MinioCfg.AccessKeyID),
|
||||
storage.SecretAccessKeyID(Params.MinioCfg.SecretAccessKey),
|
||||
storage.UseSSL(Params.MinioCfg.UseSSL),
|
||||
storage.BucketName(Params.MinioCfg.BucketName),
|
||||
storage.CreateBucket(true))
|
||||
remoteChunkManager, _ := factory.NewVectorStorageChunkManager(ctx)
|
||||
|
||||
qss := &queryShardService{
|
||||
ctx: queryShardServiceCtx,
|
||||
|
|
|
@ -45,6 +45,7 @@ type MinioChunkManager struct {
|
|||
var _ ChunkManager = (*MinioChunkManager)(nil)
|
||||
|
||||
// NewMinioChunkManager create a new local manager object.
|
||||
// Deprecated: Do not call this directly! Use factory.NewVectorStorageChunkManager instead.
|
||||
func NewMinioChunkManager(ctx context.Context, opts ...Option) (*MinioChunkManager, error) {
|
||||
c := newDefaultConfig()
|
||||
for _, opt := range opts {
|
||||
|
@ -53,6 +54,7 @@ func NewMinioChunkManager(ctx context.Context, opts ...Option) (*MinioChunkManag
|
|||
|
||||
return newMinioChunkManagerWithConfig(ctx, c)
|
||||
}
|
||||
|
||||
func newMinioChunkManagerWithConfig(ctx context.Context, c *config) (*MinioChunkManager, error) {
|
||||
minIOClient, err := minio.New(c.address, &minio.Options{
|
||||
Creds: credentials.NewStaticV4(c.accessKeyID, c.secretAccessKeyID, ""),
|
||||
|
|
|
@ -26,6 +26,7 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TODO: NewMinioChunkManager is deprecated. Rewrite this unittest.
|
||||
func newMinIOChunkManager(ctx context.Context, bucketName string) (*MinioChunkManager, error) {
|
||||
endPoint, _ := Params.Load("_MinioAddress")
|
||||
accessKeyID, _ := Params.Load("minio.accessKeyID")
|
||||
|
|
Loading…
Reference in New Issue