rootcoord

package
v0.10.3-0...-843c1f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 76 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StartOfUserFieldID id of user defined field begin from here
	StartOfUserFieldID = common.StartOfUserFieldID

	// StartOfUserFunctionID id of user defined function begin from here
	StartOfUserFunctionID = common.StartOfUserFunctionID

	// RowIDField id of row ID field
	RowIDField = common.RowIDField

	// TimeStampField id of timestamp field
	TimeStampField = common.TimeStampField

	// RowIDFieldName name of row ID field
	RowIDFieldName = common.RowIDFieldName

	// TimeStampFieldName name of the timestamp field
	TimeStampFieldName = common.TimeStampFieldName

	// MetaFieldName name of the dynamic schema field
	MetaFieldName = common.MetaFieldName
)
View Source
const (
	GetMetricsTimeout = 10 * time.Second
	SetRatesTimeout   = 10 * time.Second
)
View Source
const InvalidCollectionID = UniqueID(0)

Variables

View Source
var DefaultRateAllocateStrategy = Average

Functions

func CheckMsgType

func CheckMsgType(got, expect commonpb.MsgType) error

func CheckTimeTickLagExceeded

func CheckTimeTickLagExceeded(ctx context.Context, queryCoord types.QueryCoordClient, dataCoord types.DataCoordClient, maxDelay time.Duration) error

func ContainsKeyPairArray

func ContainsKeyPairArray(src []*commonpb.KeyValuePair, target []*commonpb.KeyValuePair) bool

func DecodeMsgPositions

func DecodeMsgPositions(str string, msgPositions *[]*msgstream.MsgPosition) error

DecodeMsgPositions deserialize string to []*MsgPosition

func EncodeMsgPositions

func EncodeMsgPositions(msgPositions []*msgstream.MsgPosition) (string, error)

EncodeMsgPositions serialize []*MsgPosition into string

func EqualKeyPairArray

func EqualKeyPairArray(p1 []*commonpb.KeyValuePair, p2 []*commonpb.KeyValuePair) bool

EqualKeyPairArray check whether 2 KeyValuePairs are equal

func FormatCollectionKey

func FormatCollectionKey(dbID int64, collectionName string) string

func GetEarliestLimiter

func GetEarliestLimiter() *ratelimitutil.Limiter

func Int64TupleMapToSlice

func Int64TupleMapToSlice(s map[int]common.Int64Tuple) []common.Int64Tuple

func Int64TupleSliceToMap

func Int64TupleSliceToMap(s []common.Int64Tuple) map[int]common.Int64Tuple

func MergeProperties

func MergeProperties(oldProps []*commonpb.KeyValuePair, updatedProps []*commonpb.KeyValuePair) []*commonpb.KeyValuePair

func NewSimpleStep

func NewSimpleStep(desc string, executeFunc func(ctx context.Context) ([]nestedStep, error)) nestedStep

func SplitCollectionKey

func SplitCollectionKey(key string) (dbID int64, collectionName string)

Types

type AlterCollectionStep

type AlterCollectionStep struct {
	// contains filtered or unexported fields
}

func (*AlterCollectionStep) Desc

func (a *AlterCollectionStep) Desc() string

func (*AlterCollectionStep) Execute

func (a *AlterCollectionStep) Execute(ctx context.Context) ([]nestedStep, error)

func (AlterCollectionStep) Weight

func (s AlterCollectionStep) Weight() stepPriority

type AlterDatabaseStep

type AlterDatabaseStep struct {
	// contains filtered or unexported fields
}

func (*AlterDatabaseStep) Desc

func (a *AlterDatabaseStep) Desc() string

func (*AlterDatabaseStep) Execute

func (a *AlterDatabaseStep) Execute(ctx context.Context) ([]nestedStep, error)

func (AlterDatabaseStep) Weight

func (s AlterDatabaseStep) Weight() stepPriority

type BroadcastAlteredCollectionStep

type BroadcastAlteredCollectionStep struct {
	// contains filtered or unexported fields
}

func (*BroadcastAlteredCollectionStep) Desc

func (*BroadcastAlteredCollectionStep) Execute

func (b *BroadcastAlteredCollectionStep) Execute(ctx context.Context) ([]nestedStep, error)

func (BroadcastAlteredCollectionStep) Weight

func (s BroadcastAlteredCollectionStep) Weight() stepPriority

type Broker

type Broker interface {
	ReleaseCollection(ctx context.Context, collectionID UniqueID) error
	ReleasePartitions(ctx context.Context, collectionID UniqueID, partitionIDs ...UniqueID) error
	SyncNewCreatedPartition(ctx context.Context, collectionID UniqueID, partitionID UniqueID) error
	GetQuerySegmentInfo(ctx context.Context, collectionID int64, segIDs []int64) (retResp *querypb.GetSegmentInfoResponse, retErr error)

	WatchChannels(ctx context.Context, info *watchInfo) error
	UnwatchChannels(ctx context.Context, info *watchInfo) error
	GetSegmentStates(context.Context, *datapb.GetSegmentStatesRequest) (*datapb.GetSegmentStatesResponse, error)
	GcConfirm(ctx context.Context, collectionID, partitionID UniqueID) bool

	DropCollectionIndex(ctx context.Context, collID UniqueID, partIDs []UniqueID) error
	// notify observer to clean their meta cache
	BroadcastAlteredCollection(ctx context.Context, req *milvuspb.AlterCollectionRequest) error
}

Broker communicates with other components.

type Core

type Core struct {
	// contains filtered or unexported fields
}

Core root coordinator core

func NewCore

func NewCore(c context.Context, factory dependency.Factory) (*Core, error)

NewCore creates a new rootcoord core

func (*Core) AllocID

AllocID alloc ids

func (*Core) AllocTimestamp

AllocTimestamp alloc timestamp

func (*Core) AlterAlias

func (c *Core) AlterAlias(ctx context.Context, in *milvuspb.AlterAliasRequest) (*commonpb.Status, error)

AlterAlias alter collection alias

func (*Core) AlterCollection

func (c *Core) AlterCollection(ctx context.Context, in *milvuspb.AlterCollectionRequest) (*commonpb.Status, error)

func (*Core) AlterDatabase

func (c *Core) AlterDatabase(ctx context.Context, in *rootcoordpb.AlterDatabaseRequest) (*commonpb.Status, error)

func (*Core) CheckHealth

func (*Core) CreateAlias

func (c *Core) CreateAlias(ctx context.Context, in *milvuspb.CreateAliasRequest) (*commonpb.Status, error)

CreateAlias create collection alias

func (*Core) CreateCollection

func (c *Core) CreateCollection(ctx context.Context, in *milvuspb.CreateCollectionRequest) (*commonpb.Status, error)

CreateCollection create collection

func (*Core) CreateCredential

func (c *Core) CreateCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) (*commonpb.Status, error)

CreateCredential create new user and password

  1. decode ciphertext password to raw password
  2. encrypt raw password
  3. save in to etcd

func (*Core) CreateDatabase

func (c *Core) CreateDatabase(ctx context.Context, in *milvuspb.CreateDatabaseRequest) (*commonpb.Status, error)

func (*Core) CreatePartition

func (c *Core) CreatePartition(ctx context.Context, in *milvuspb.CreatePartitionRequest) (*commonpb.Status, error)

CreatePartition create partition

func (*Core) CreatePrivilegeGroup

func (c *Core) CreatePrivilegeGroup(ctx context.Context, in *milvuspb.CreatePrivilegeGroupRequest) (*commonpb.Status, error)

func (*Core) CreateRole

func (c *Core) CreateRole(ctx context.Context, in *milvuspb.CreateRoleRequest) (*commonpb.Status, error)

CreateRole create role - check the node health - check if the role is existed - check if the role num has reached the limit - create the role by the meta api

func (*Core) DeleteCredential

func (c *Core) DeleteCredential(ctx context.Context, in *milvuspb.DeleteCredentialRequest) (*commonpb.Status, error)

DeleteCredential delete a user

func (*Core) DescribeAlias

DescribeAlias describe collection alias

func (*Core) DescribeCollection

DescribeCollection return collection info

func (*Core) DescribeCollectionInternal

func (c *Core) DescribeCollectionInternal(ctx context.Context, in *milvuspb.DescribeCollectionRequest) (*milvuspb.DescribeCollectionResponse, error)

DescribeCollectionInternal same to DescribeCollection, but will return unavailable collections and only used in internal RPC. When query cluster tried to do recovery, it'll be healthy until all collections' targets were recovered, so during this time, releasing request generated by rootcoord's recovery won't succeed. So in theory, rootcoord goes to be healthy, querycoord recovers all collections' targets, and then querycoord serves the releasing request sent by rootcoord, eventually, the dropping collections will be released.

func (*Core) DropAlias

func (c *Core) DropAlias(ctx context.Context, in *milvuspb.DropAliasRequest) (*commonpb.Status, error)

DropAlias drop collection alias

func (*Core) DropCollection

func (c *Core) DropCollection(ctx context.Context, in *milvuspb.DropCollectionRequest) (*commonpb.Status, error)

DropCollection drop collection

func (*Core) DropDatabase

func (c *Core) DropDatabase(ctx context.Context, in *milvuspb.DropDatabaseRequest) (*commonpb.Status, error)

func (*Core) DropPartition

func (c *Core) DropPartition(ctx context.Context, in *milvuspb.DropPartitionRequest) (*commonpb.Status, error)

DropPartition drop partition

func (*Core) DropPrivilegeGroup

func (c *Core) DropPrivilegeGroup(ctx context.Context, in *milvuspb.DropPrivilegeGroupRequest) (*commonpb.Status, error)

func (*Core) DropRole

func (c *Core) DropRole(ctx context.Context, in *milvuspb.DropRoleRequest) (*commonpb.Status, error)

DropRole drop role - check the node health - check if the role name is existed - check if the role has some grant info - get all role mapping of this role - drop these role mappings - drop the role by the meta api

func (*Core) ExpireCredCache

func (c *Core) ExpireCredCache(ctx context.Context, username string) error

ExpireCredCache will call invalidate credential cache

func (*Core) ExpireMetaCache

func (c *Core) ExpireMetaCache(ctx context.Context, dbName string, collNames []string, collectionID UniqueID, partitionName string, ts typeutil.Timestamp, opts ...proxyutil.ExpireCacheOpt) error

ExpireMetaCache will call invalidate collection meta cache

func (*Core) GetComponentStates

func (c *Core) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error)

GetComponentStates get states of components

func (*Core) GetCredential

GetCredential get credential by username

func (*Core) GetMetrics

GetMetrics get metrics

func (*Core) GetPChannelInfo

GetPChannelInfo get pchannel info.

func (*Core) GetStateCode

func (c *Core) GetStateCode() commonpb.StateCode

func (*Core) GetStatisticsChannel

func (c *Core) GetStatisticsChannel(ctx context.Context, req *internalpb.GetStatisticsChannelRequest) (*milvuspb.StringResponse, error)

GetStatisticsChannel get statistics channel name

func (*Core) GetTimeTickChannel

GetTimeTickChannel get timetick channel name

func (*Core) HasCollection

HasCollection check collection existence

func (*Core) HasPartition

HasPartition check partition existence

func (*Core) Init

func (c *Core) Init() error

Init initialize routine

func (*Core) InvalidateCollectionMetaCache

func (c *Core) InvalidateCollectionMetaCache(ctx context.Context, in *proxypb.InvalidateCollMetaCacheRequest) (*commonpb.Status, error)

InvalidateCollectionMetaCache notifies RootCoord to release the collection cache in Proxies.

func (*Core) ListAliases

ListAliases list aliases

func (*Core) ListCredUsers

ListCredUsers list all usernames

func (*Core) OperatePrivilege

func (c *Core) OperatePrivilege(ctx context.Context, in *milvuspb.OperatePrivilegeRequest) (*commonpb.Status, error)

OperatePrivilege operate the privilege, including grant and revoke - check the node health - check if the operating type is valid - check if the entity is nil - check if the params, including the resource entity, the principal entity, the grantor entity, is valid - operate the privilege by the meta api - update the policy cache

func (*Core) OperatePrivilegeGroup

func (c *Core) OperatePrivilegeGroup(ctx context.Context, in *milvuspb.OperatePrivilegeGroupRequest) (*commonpb.Status, error)

func (*Core) OperateUserRole

func (c *Core) OperateUserRole(ctx context.Context, in *milvuspb.OperateUserRoleRequest) (*commonpb.Status, error)

OperateUserRole operate the relationship between a user and a role - check the node health - check if the role is valid - check if the user is valid - operate the user-role by the meta api - update the policy cache

func (*Core) Register

func (c *Core) Register() error

Register register rootcoord at etcd

func (*Core) RenameCollection

func (c *Core) RenameCollection(ctx context.Context, req *milvuspb.RenameCollectionRequest) (*commonpb.Status, error)

func (*Core) RestoreRBAC

func (c *Core) RestoreRBAC(ctx context.Context, in *milvuspb.RestoreRBACMetaRequest) (*commonpb.Status, error)

func (*Core) SelectGrant

SelectGrant select grant - check the node health - check if the principal entity is valid - check if the resource entity which is provided by the user is valid - select grant by the meta api

func (*Core) SelectRole

SelectRole select role - check the node health - check if the role is valid when this param is provided - select role by the meta api

func (*Core) SelectUser

SelectUser select user - check the node health - check if the user is valid when this param is provided - select user by the meta api

func (*Core) SetAddress

func (c *Core) SetAddress(address string)

func (*Core) SetDataCoordClient

func (c *Core) SetDataCoordClient(s types.DataCoordClient) error

func (*Core) SetEtcdClient

func (c *Core) SetEtcdClient(etcdClient *clientv3.Client)

SetEtcdClient sets the etcdCli of Core

func (*Core) SetProxyCreator

func (c *Core) SetProxyCreator(f func(ctx context.Context, addr string, nodeID int64) (types.ProxyClient, error))

func (*Core) SetQueryCoordClient

func (c *Core) SetQueryCoordClient(s types.QueryCoordClient) error

func (*Core) SetTiKVClient

func (c *Core) SetTiKVClient(client *txnkv.Client)

SetTiKVClient sets the tikvCli of Core

func (*Core) ShowCollections

ShowCollections list all collection names

func (*Core) ShowConfigurations

ShowConfigurations returns the configurations of RootCoord matching req.Pattern

func (*Core) ShowPartitions

ShowPartitions list all partition names

func (*Core) ShowPartitionsInternal

func (c *Core) ShowPartitionsInternal(ctx context.Context, in *milvuspb.ShowPartitionsRequest) (*milvuspb.ShowPartitionsResponse, error)

ShowPartitionsInternal same to ShowPartitions, only used in internal RPC.

func (*Core) ShowSegments

ShowSegments list all segments

func (*Core) Start

func (c *Core) Start() error

Start starts RootCoord.

func (*Core) Stop

func (c *Core) Stop() error

Stop stops rootCoord.

func (*Core) UpdateChannelTimeTick

func (c *Core) UpdateChannelTimeTick(ctx context.Context, in *internalpb.ChannelTimeTickMsg) (*commonpb.Status, error)

UpdateChannelTimeTick used to handle ChannelTimeTickMsg

func (*Core) UpdateCredCache

func (c *Core) UpdateCredCache(ctx context.Context, credInfo *internalpb.CredentialInfo) error

UpdateCredCache will call update credential cache

func (*Core) UpdateCredential

func (c *Core) UpdateCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) (*commonpb.Status, error)

UpdateCredential update password for a user

func (*Core) UpdateStateCode

func (c *Core) UpdateStateCode(code commonpb.StateCode)

UpdateStateCode update state code

type DdlTsLockManager

type DdlTsLockManager interface {
	GetMinDdlTs() Timestamp
	AddRefCnt(delta int32)
	Lock()
	Unlock()
	UpdateLastTs(ts Timestamp)
}

type GarbageCollector

type GarbageCollector interface {
	ReDropCollection(collMeta *model.Collection, ts Timestamp)
	RemoveCreatingCollection(collMeta *model.Collection)
	ReDropPartition(dbID int64, pChannels, vchannels []string, partition *model.Partition, ts Timestamp)
	RemoveCreatingPartition(dbID int64, partition *model.Partition, ts Timestamp)
	GcCollectionData(ctx context.Context, coll *model.Collection) (ddlTs Timestamp, err error)
	GcPartitionData(ctx context.Context, pChannels, vchannels []string, partition *model.Partition) (ddlTs Timestamp, err error)
}

type IMetaTable

type IMetaTable interface {
	GetDatabaseByID(ctx context.Context, dbID int64, ts Timestamp) (*model.Database, error)
	GetDatabaseByName(ctx context.Context, dbName string, ts Timestamp) (*model.Database, error)
	CreateDatabase(ctx context.Context, db *model.Database, ts typeutil.Timestamp) error
	DropDatabase(ctx context.Context, dbName string, ts typeutil.Timestamp) error
	ListDatabases(ctx context.Context, ts typeutil.Timestamp) ([]*model.Database, error)
	AlterDatabase(ctx context.Context, oldDB *model.Database, newDB *model.Database, ts typeutil.Timestamp) error

	AddCollection(ctx context.Context, coll *model.Collection) error
	ChangeCollectionState(ctx context.Context, collectionID UniqueID, state pb.CollectionState, ts Timestamp) error
	RemoveCollection(ctx context.Context, collectionID UniqueID, ts Timestamp) error
	GetCollectionByName(ctx context.Context, dbName string, collectionName string, ts Timestamp) (*model.Collection, error)
	GetCollectionByID(ctx context.Context, dbName string, collectionID UniqueID, ts Timestamp, allowUnavailable bool) (*model.Collection, error)
	GetCollectionByIDWithMaxTs(ctx context.Context, collectionID UniqueID) (*model.Collection, error)
	ListCollections(ctx context.Context, dbName string, ts Timestamp, onlyAvail bool) ([]*model.Collection, error)
	ListAllAvailCollections(ctx context.Context) map[int64][]int64
	ListCollectionPhysicalChannels(ctx context.Context) map[typeutil.UniqueID][]string
	GetCollectionVirtualChannels(ctx context.Context, colID int64) []string
	GetPChannelInfo(ctx context.Context, pchannel string) *rootcoordpb.GetPChannelInfoResponse
	AddPartition(ctx context.Context, partition *model.Partition) error
	ChangePartitionState(ctx context.Context, collectionID UniqueID, partitionID UniqueID, state pb.PartitionState, ts Timestamp) error
	RemovePartition(ctx context.Context, dbID int64, collectionID UniqueID, partitionID UniqueID, ts Timestamp) error
	CreateAlias(ctx context.Context, dbName string, alias string, collectionName string, ts Timestamp) error
	DropAlias(ctx context.Context, dbName string, alias string, ts Timestamp) error
	AlterAlias(ctx context.Context, dbName string, alias string, collectionName string, ts Timestamp) error
	DescribeAlias(ctx context.Context, dbName string, alias string, ts Timestamp) (string, error)
	ListAliases(ctx context.Context, dbName string, collectionName string, ts Timestamp) ([]string, error)
	AlterCollection(ctx context.Context, oldColl *model.Collection, newColl *model.Collection, ts Timestamp) error
	RenameCollection(ctx context.Context, dbName string, oldName string, newDBName string, newName string, ts Timestamp) error

	// TODO: it'll be a big cost if we handle the time travel logic, since we should always list all aliases in catalog.
	IsAlias(ctx context.Context, db, name string) bool
	ListAliasesByID(ctx context.Context, collID UniqueID) []string

	AddCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) error
	GetCredential(ctx context.Context, username string) (*internalpb.CredentialInfo, error)
	DeleteCredential(ctx context.Context, username string) error
	AlterCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) error
	ListCredentialUsernames(ctx context.Context) (*milvuspb.ListCredUsersResponse, error)

	CreateRole(ctx context.Context, tenant string, entity *milvuspb.RoleEntity) error
	DropRole(ctx context.Context, tenant string, roleName string) error
	OperateUserRole(ctx context.Context, tenant string, userEntity *milvuspb.UserEntity, roleEntity *milvuspb.RoleEntity, operateType milvuspb.OperateUserRoleType) error
	SelectRole(ctx context.Context, tenant string, entity *milvuspb.RoleEntity, includeUserInfo bool) ([]*milvuspb.RoleResult, error)
	SelectUser(ctx context.Context, tenant string, entity *milvuspb.UserEntity, includeRoleInfo bool) ([]*milvuspb.UserResult, error)
	OperatePrivilege(ctx context.Context, tenant string, entity *milvuspb.GrantEntity, operateType milvuspb.OperatePrivilegeType) error
	SelectGrant(ctx context.Context, tenant string, entity *milvuspb.GrantEntity) ([]*milvuspb.GrantEntity, error)
	DropGrant(ctx context.Context, tenant string, role *milvuspb.RoleEntity) error
	ListPolicy(ctx context.Context, tenant string) ([]string, error)
	ListUserRole(ctx context.Context, tenant string) ([]string, error)
	BackupRBAC(ctx context.Context, tenant string) (*milvuspb.RBACMeta, error)
	RestoreRBAC(ctx context.Context, tenant string, meta *milvuspb.RBACMeta) error
	IsCustomPrivilegeGroup(ctx context.Context, groupName string) (bool, error)
	CreatePrivilegeGroup(ctx context.Context, groupName string) error
	DropPrivilegeGroup(ctx context.Context, groupName string) error
	ListPrivilegeGroups(ctx context.Context) ([]*milvuspb.PrivilegeGroupInfo, error)
	OperatePrivilegeGroup(ctx context.Context, groupName string, privileges []*milvuspb.PrivilegeEntity, operateType milvuspb.OperatePrivilegeGroupType) error
	GetPrivilegeGroupRoles(ctx context.Context, groupName string) ([]*milvuspb.RoleEntity, error)
}

type IScheduler

type IScheduler interface {
	Start()
	Stop()
	AddTask(t task) error
	GetMinDdlTs() Timestamp
}

type Limit

type Limit = ratelimitutil.Limit

type LimiterRange

type LimiterRange struct {
	RateScope        internalpb.RateScope
	OpType           opType
	ExcludeRateTypes typeutil.Set[internalpb.RateType]
}

type LockLevel

type LockLevel int
const (
	ClusterLock LockLevel = iota
	DatabaseLock
	CollectionLock
)

type LockerKey

type LockerKey interface {
	LockKey() string
	Level() LockLevel
	IsWLock() bool
	Next() LockerKey
}

func NewClusterLockerKey

func NewClusterLockerKey(rw bool) LockerKey

func NewCollectionLockerKey

func NewCollectionLockerKey(collection string, rw bool) LockerKey

func NewDatabaseLockerKey

func NewDatabaseLockerKey(db string, rw bool) LockerKey

func NewLockerKeyChain

func NewLockerKeyChain(lockerKeys ...LockerKey) LockerKey

type MetaTable

type MetaTable struct {
	// contains filtered or unexported fields
}

MetaTable is a persistent meta set of all databases, collections and partitions.

func NewMetaTable

func NewMetaTable(ctx context.Context, catalog metastore.RootCoordCatalog, tsoAllocator tso.Allocator) (*MetaTable, error)

NewMetaTable creates a new MetaTable with specified catalog and allocator.

func (*MetaTable) AddCollection

func (mt *MetaTable) AddCollection(ctx context.Context, coll *model.Collection) error

func (*MetaTable) AddCredential

func (mt *MetaTable) AddCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) error

AddCredential add credential

func (*MetaTable) AddPartition

func (mt *MetaTable) AddPartition(ctx context.Context, partition *model.Partition) error

func (*MetaTable) AlterAlias

func (mt *MetaTable) AlterAlias(ctx context.Context, dbName string, alias string, collectionName string, ts Timestamp) error

func (*MetaTable) AlterCollection

func (mt *MetaTable) AlterCollection(ctx context.Context, oldColl *model.Collection, newColl *model.Collection, ts Timestamp) error

func (*MetaTable) AlterCredential

func (mt *MetaTable) AlterCredential(ctx context.Context, credInfo *internalpb.CredentialInfo) error

AlterCredential update credential

func (*MetaTable) AlterDatabase

func (mt *MetaTable) AlterDatabase(ctx context.Context, oldDB *model.Database, newDB *model.Database, ts typeutil.Timestamp) error

func (*MetaTable) BackupRBAC

func (mt *MetaTable) BackupRBAC(ctx context.Context, tenant string) (*milvuspb.RBACMeta, error)

func (*MetaTable) ChangeCollectionState

func (mt *MetaTable) ChangeCollectionState(ctx context.Context, collectionID UniqueID, state pb.CollectionState, ts Timestamp) error

func (*MetaTable) ChangePartitionState

func (mt *MetaTable) ChangePartitionState(ctx context.Context, collectionID UniqueID, partitionID UniqueID, state pb.PartitionState, ts Timestamp) error

func (*MetaTable) CreateAlias

func (mt *MetaTable) CreateAlias(ctx context.Context, dbName string, alias string, collectionName string, ts Timestamp) error

func (*MetaTable) CreateDatabase

func (mt *MetaTable) CreateDatabase(ctx context.Context, db *model.Database, ts typeutil.Timestamp) error

func (*MetaTable) CreatePrivilegeGroup

func (mt *MetaTable) CreatePrivilegeGroup(ctx context.Context, groupName string) error

func (*MetaTable) CreateRole

func (mt *MetaTable) CreateRole(ctx context.Context, tenant string, entity *milvuspb.RoleEntity) error

CreateRole create role

func (*MetaTable) DeleteCredential

func (mt *MetaTable) DeleteCredential(ctx context.Context, username string) error

DeleteCredential delete credential

func (*MetaTable) DescribeAlias

func (mt *MetaTable) DescribeAlias(ctx context.Context, dbName string, alias string, ts Timestamp) (string, error)

func (*MetaTable) DropAlias

func (mt *MetaTable) DropAlias(ctx context.Context, dbName string, alias string, ts Timestamp) error

func (*MetaTable) DropDatabase

func (mt *MetaTable) DropDatabase(ctx context.Context, dbName string, ts typeutil.Timestamp) error

func (*MetaTable) DropGrant

func (mt *MetaTable) DropGrant(ctx context.Context, tenant string, role *milvuspb.RoleEntity) error

func (*MetaTable) DropPrivilegeGroup

func (mt *MetaTable) DropPrivilegeGroup(ctx context.Context, groupName string) error

func (*MetaTable) DropRole

func (mt *MetaTable) DropRole(ctx context.Context, tenant string, roleName string) error

DropRole drop role info

func (*MetaTable) GetCollectionByID

func (mt *MetaTable) GetCollectionByID(ctx context.Context, dbName string, collectionID UniqueID, ts Timestamp, allowUnavailable bool) (*model.Collection, error)

func (*MetaTable) GetCollectionByIDWithMaxTs

func (mt *MetaTable) GetCollectionByIDWithMaxTs(ctx context.Context, collectionID UniqueID) (*model.Collection, error)

GetCollectionByIDWithMaxTs get collection, dbName can be ignored if ts is max timestamps

func (*MetaTable) GetCollectionByName

func (mt *MetaTable) GetCollectionByName(ctx context.Context, dbName string, collectionName string, ts Timestamp) (*model.Collection, error)

func (*MetaTable) GetCollectionVirtualChannels

func (mt *MetaTable) GetCollectionVirtualChannels(ctx context.Context, colID int64) []string

GetCollectionVirtualChannels returns virtual channels of a given collection.

func (*MetaTable) GetCredential

func (mt *MetaTable) GetCredential(ctx context.Context, username string) (*internalpb.CredentialInfo, error)

GetCredential get credential by username

func (*MetaTable) GetDatabaseByID

func (mt *MetaTable) GetDatabaseByID(ctx context.Context, dbID int64, ts Timestamp) (*model.Database, error)

func (*MetaTable) GetDatabaseByName

func (mt *MetaTable) GetDatabaseByName(ctx context.Context, dbName string, ts Timestamp) (*model.Database, error)

func (*MetaTable) GetPChannelInfo

func (mt *MetaTable) GetPChannelInfo(ctx context.Context, pchannel string) *rootcoordpb.GetPChannelInfoResponse

GetPChannelInfo returns infos on pchannel.

func (*MetaTable) GetPrivilegeGroupRoles

func (mt *MetaTable) GetPrivilegeGroupRoles(ctx context.Context, groupName string) ([]*milvuspb.RoleEntity, error)

func (*MetaTable) IsAlias

func (mt *MetaTable) IsAlias(ctx context.Context, db, name string) bool

func (*MetaTable) IsCustomPrivilegeGroup

func (mt *MetaTable) IsCustomPrivilegeGroup(ctx context.Context, groupName string) (bool, error)

check if the privielge group name is defined by users

func (*MetaTable) ListAliases

func (mt *MetaTable) ListAliases(ctx context.Context, dbName string, collectionName string, ts Timestamp) ([]string, error)

func (*MetaTable) ListAliasesByID

func (mt *MetaTable) ListAliasesByID(ctx context.Context, collID UniqueID) []string

func (*MetaTable) ListAllAvailCollections

func (mt *MetaTable) ListAllAvailCollections(ctx context.Context) map[int64][]int64

func (*MetaTable) ListCollectionPhysicalChannels

func (mt *MetaTable) ListCollectionPhysicalChannels(ctx context.Context) map[typeutil.UniqueID][]string

ListCollectionPhysicalChannels list physical channels of all collections.

func (*MetaTable) ListCollections

func (mt *MetaTable) ListCollections(ctx context.Context, dbName string, ts Timestamp, onlyAvail bool) ([]*model.Collection, error)

func (*MetaTable) ListCredentialUsernames

func (mt *MetaTable) ListCredentialUsernames(ctx context.Context) (*milvuspb.ListCredUsersResponse, error)

ListCredentialUsernames list credential usernames

func (*MetaTable) ListDatabases

func (mt *MetaTable) ListDatabases(ctx context.Context, ts typeutil.Timestamp) ([]*model.Database, error)

func (*MetaTable) ListPolicy

func (mt *MetaTable) ListPolicy(ctx context.Context, tenant string) ([]string, error)

func (*MetaTable) ListPrivilegeGroups

func (mt *MetaTable) ListPrivilegeGroups(ctx context.Context) ([]*milvuspb.PrivilegeGroupInfo, error)

func (*MetaTable) ListUserRole

func (mt *MetaTable) ListUserRole(ctx context.Context, tenant string) ([]string, error)

func (*MetaTable) OperatePrivilege

func (mt *MetaTable) OperatePrivilege(ctx context.Context, tenant string, entity *milvuspb.GrantEntity, operateType milvuspb.OperatePrivilegeType) error

OperatePrivilege grant or revoke privilege by setting the operateType param

func (*MetaTable) OperatePrivilegeGroup

func (mt *MetaTable) OperatePrivilegeGroup(ctx context.Context, groupName string, privileges []*milvuspb.PrivilegeEntity, operateType milvuspb.OperatePrivilegeGroupType) error

func (*MetaTable) OperateUserRole

func (mt *MetaTable) OperateUserRole(ctx context.Context, tenant string, userEntity *milvuspb.UserEntity, roleEntity *milvuspb.RoleEntity, operateType milvuspb.OperateUserRoleType) error

OperateUserRole operate the relationship between a user and a role, including adding a user to a role and removing a user from a role

func (*MetaTable) RemoveCollection

func (mt *MetaTable) RemoveCollection(ctx context.Context, collectionID UniqueID, ts Timestamp) error

func (*MetaTable) RemovePartition

func (mt *MetaTable) RemovePartition(ctx context.Context, dbID int64, collectionID UniqueID, partitionID UniqueID, ts Timestamp) error

func (*MetaTable) RenameCollection

func (mt *MetaTable) RenameCollection(ctx context.Context, dbName string, oldName string, newDBName string, newName string, ts Timestamp) error

func (*MetaTable) RestoreRBAC

func (mt *MetaTable) RestoreRBAC(ctx context.Context, tenant string, meta *milvuspb.RBACMeta) error

func (*MetaTable) SelectGrant

func (mt *MetaTable) SelectGrant(ctx context.Context, tenant string, entity *milvuspb.GrantEntity) ([]*milvuspb.GrantEntity, error)

SelectGrant select grant The principal entity MUST be not empty in the grant entity The resource entity and the resource name are optional, and the two params should be not empty together when you select some grants about the resource kind.

func (*MetaTable) SelectRole

func (mt *MetaTable) SelectRole(ctx context.Context, tenant string, entity *milvuspb.RoleEntity, includeUserInfo bool) ([]*milvuspb.RoleResult, error)

SelectRole select role. Enter the role condition by the entity param. And this param is nil, which means selecting all roles. Get all users that are added to the role by setting the includeUserInfo param to true.

func (*MetaTable) SelectUser

func (mt *MetaTable) SelectUser(ctx context.Context, tenant string, entity *milvuspb.UserEntity, includeRoleInfo bool) ([]*milvuspb.UserResult, error)

SelectUser select user. Enter the user condition by the entity param. And this param is nil, which means selecting all users. Get all roles that are added the user to by setting the includeRoleInfo param to true.

type Opt

type Opt func(*Core)

type QuotaCenter

type QuotaCenter struct {
	// contains filtered or unexported fields
}

QuotaCenter manages the quota and limitations of the whole cluster, it receives metrics info from DataNodes, QueryNodes and Proxies, and notifies Proxies to limit rate of requests from clients or reject all requests when the cluster met resources issues. Limitations:

  1. DML throughput limitation;
  2. DDL, DQL qps/rps limitation;

Protections:

  1. TT protection -> dqlRate = maxDQLRate * (maxDelay - ttDelay) / maxDelay
  2. Memory protection -> dmlRate = maxDMLRate * (highMem - curMem) / (highMem - lowMem)
  3. Disk quota protection -> force deny writing if exceeded
  4. DQL Queue length protection -> dqlRate = curDQLRate * CoolOffSpeed
  5. DQL queue latency protection -> dqlRate = curDQLRate * CoolOffSpeed
  6. Search result protection -> searchRate = curSearchRate * CoolOffSpeed
  7. GrowingSegsSize protection -> dmlRate = maxDMLRate * (high - cur) / (high - low)

If necessary, user can also manually force to deny RW requests.

func NewQuotaCenter

func NewQuotaCenter(proxies proxyutil.ProxyClientManagerInterface, queryCoord types.QueryCoordClient,
	dataCoord types.DataCoordClient, tsoAllocator tso.Allocator, meta IMetaTable,
) *QuotaCenter

NewQuotaCenter returns a new QuotaCenter.

func (*QuotaCenter) Start

func (q *QuotaCenter) Start()

type RateAllocateStrategy

type RateAllocateStrategy int32
const (
	Average      RateAllocateStrategy = 0
	ByRateWeight RateAllocateStrategy = 1
)

type ServerBroker

type ServerBroker struct {
	// contains filtered or unexported fields
}

func (*ServerBroker) BroadcastAlteredCollection

func (b *ServerBroker) BroadcastAlteredCollection(ctx context.Context, req *milvuspb.AlterCollectionRequest) error

func (*ServerBroker) DropCollectionIndex

func (b *ServerBroker) DropCollectionIndex(ctx context.Context, collID UniqueID, partIDs []UniqueID) error

func (*ServerBroker) GcConfirm

func (b *ServerBroker) GcConfirm(ctx context.Context, collectionID, partitionID UniqueID) bool

func (*ServerBroker) GetQuerySegmentInfo

func (b *ServerBroker) GetQuerySegmentInfo(ctx context.Context, collectionID int64, segIDs []int64) (retResp *querypb.GetSegmentInfoResponse, retErr error)

func (*ServerBroker) GetSegmentIndexState

func (b *ServerBroker) GetSegmentIndexState(ctx context.Context, collID UniqueID, indexName string, segIDs []UniqueID) ([]*indexpb.SegmentIndexState, error)

func (*ServerBroker) GetSegmentStates

func (*ServerBroker) ReleaseCollection

func (b *ServerBroker) ReleaseCollection(ctx context.Context, collectionID UniqueID) error

func (*ServerBroker) ReleasePartitions

func (b *ServerBroker) ReleasePartitions(ctx context.Context, collectionID UniqueID, partitionIDs ...UniqueID) error

func (*ServerBroker) SyncNewCreatedPartition

func (b *ServerBroker) SyncNewCreatedPartition(ctx context.Context, collectionID UniqueID, partitionID UniqueID) error

func (*ServerBroker) UnwatchChannels

func (b *ServerBroker) UnwatchChannels(ctx context.Context, info *watchInfo) error

func (*ServerBroker) WatchChannels

func (b *ServerBroker) WatchChannels(ctx context.Context, info *watchInfo) error

type StepExecutor

type StepExecutor interface {
	Start()
	Stop()
	AddSteps(s *stepStack)
}

type TimeTravelRequest

type TimeTravelRequest interface {
	GetBase() *commonpb.MsgBase
	GetTimeStamp() Timestamp
}

type Timestamp

type Timestamp = typeutil.Timestamp

Timestamp is an alias of typeutil.Timestamp

type UniqueID

type UniqueID = typeutil.UniqueID

UniqueID is an alias of typeutil.UniqueID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL