Zhen Ye 21724ab52c
enhance: generate guaranteets at delegator if local wal (#39799)
issue: #38399, #39892

- use mvcc timestamp of wal as guaranteets if wal and delegator is
located at same node.
- fix: ignore growing option is lost at hibridsearch

---------

Signed-off-by: chyezh <chyezh@outlook.com>
2025-02-17 15:22:15 +08:00

41 lines
1.2 KiB
Go

package wal
import (
"context"
"github.com/milvus-io/milvus/pkg/streaming/util/message"
"github.com/milvus-io/milvus/pkg/streaming/util/types"
)
type AppendResult = types.AppendResult
// WAL is the WAL framework interface.
// !!! Don't implement it directly, implement walimpls.WAL instead.
type WAL interface {
WALName() string
// GetLatestMVCCTimestamp get the latest mvcc timestamp of the wal at vchannel.
GetLatestMVCCTimestamp(ctx context.Context, vchannel string) (uint64, error)
// Channel returns the channel assignment info of the wal.
Channel() types.PChannelInfo
// Append writes a record to the log.
Append(ctx context.Context, msg message.MutableMessage) (*AppendResult, error)
// Append a record to the log asynchronously.
AppendAsync(ctx context.Context, msg message.MutableMessage, cb func(*AppendResult, error))
// Read returns a scanner for reading records from the wal.
Read(ctx context.Context, deliverPolicy ReadOption) (Scanner, error)
// Available return a channel that will be closed when the wal is available.
Available() <-chan struct{}
// IsAvailable returns if the wal is available.
IsAvailable() bool
// Close closes the wal instance.
Close()
}