mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
issue: #41544 - add a lock interceptor at vchannel granularity. - make txn manager recoverable and add FailTxnAtVChannel operation. Signed-off-by: chyezh <chyezh@outlook.com>
24 lines
780 B
Go
24 lines
780 B
Go
package lock
|
|
|
|
import (
|
|
"github.com/milvus-io/milvus/internal/streamingnode/server/wal/interceptors"
|
|
"github.com/milvus-io/milvus/pkg/v2/util/lock"
|
|
)
|
|
|
|
// NewInterceptorBuilder creates a new redo interceptor builder.
|
|
// TODO: add it into wal after recovery storage is merged.
|
|
func NewInterceptorBuilder() interceptors.InterceptorBuilder {
|
|
return &interceptorBuilder{}
|
|
}
|
|
|
|
// interceptorBuilder is the builder for redo interceptor.
|
|
type interceptorBuilder struct{}
|
|
|
|
// Build creates a new redo interceptor.
|
|
func (b *interceptorBuilder) Build(param *interceptors.InterceptorBuildParam) interceptors.Interceptor {
|
|
return &lockAppendInterceptor{
|
|
vchannelLocker: lock.NewKeyLock[string](),
|
|
// TODO: txnManager will be intiailized by param txnManager: param.TxnManager,
|
|
}
|
|
}
|