Zhen Ye 3dd9a1147b
enhance: add lock interceptor and recoverable txn manager (#41640)
issue: #41544

- add a lock interceptor at vchannel granularity.
- make txn manager recoverable and add FailTxnAtVChannel operation.

Signed-off-by: chyezh <chyezh@outlook.com>
2025-05-09 11:14:53 +08:00

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,
}
}