Skip to content

Commit

Permalink
MB-42890 Change the format for keyspace logging in IndexInstList/Map
Browse files Browse the repository at this point in the history
Rest of the places uses bucket:scope:collection while IndexInstList
and IndexInstMap uses bucket/scope/collection. This slightly
complicates the search of keyspace in logs. Hence, change the
keyspace logging to bucket:scope:collection in IndexInstList and
IndexInstMap

Change-Id: Ifc05a959547b25c4583dc0c322ee9d6b305ac7e3
  • Loading branch information
varunv-cb committed Dec 9, 2020
1 parent b4d8a43 commit 06410fa
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions secondary/common/index.go
Expand Up @@ -241,18 +241,18 @@ type IndexDefn struct {

// transient field (not part of index metadata)
// These fields are used for create index during DDL, rebalance, or restore
InstVersion int `json:"instanceVersion,omitempty"`
ReplicaId int `json:"replicaId,omitempty"`
InstId IndexInstId `json:"instanceId,omitempty"`
InstVersion int `json:"instanceVersion,omitempty"`
ReplicaId int `json:"replicaId,omitempty"`
InstId IndexInstId `json:"instanceId,omitempty"`

// Partitions contains either the IDs of all partitions in the
// index, or in the case of a rebalance only that subset of IDs
// of the specific partitions being moved by the current TransferToken.
Partitions []PartitionId `json:"partitions,omitempty"`
Partitions []PartitionId `json:"partitions,omitempty"`

Versions []int `json:"versions,omitempty"`
NumPartitions uint32 `json:"numPartitions,omitempty"`
RealInstId IndexInstId `json:"realInstId,omitempty"`
Versions []int `json:"versions,omitempty"`
NumPartitions uint32 `json:"numPartitions,omitempty"`
RealInstId IndexInstId `json:"realInstId,omitempty"`
}

//IndexInst is an instance of an Index(aka replica)
Expand Down Expand Up @@ -511,7 +511,7 @@ func (idx IndexInstMap) String() string {
for i, index := range idx {
str += fmt.Sprintf("\tInstanceId: %v ", i)
str += fmt.Sprintf("Name: %v ", index.Defn.Name)
str += fmt.Sprintf("Keyspace: %v/%v/%v ", index.Defn.Bucket,
str += fmt.Sprintf("Keyspace: %v:%v:%v ", index.Defn.Bucket,
index.Defn.Scope, index.Defn.Collection)
str += fmt.Sprintf("State: %v ", index.State)
str += fmt.Sprintf("Stream: %v ", index.Stream)
Expand All @@ -533,7 +533,7 @@ func (idx IndexInstList) String() string {
for _, index := range idx {
str += fmt.Sprintf("\tInstanceId: %v ", index.InstId)
str += fmt.Sprintf("Name: %v ", index.Defn.Name)
str += fmt.Sprintf("Keyspace: %v/%v/%v ", index.Defn.Bucket,
str += fmt.Sprintf("Keyspace: %v:%v:%v ", index.Defn.Bucket,
index.Defn.Scope, index.Defn.Collection)
str += fmt.Sprintf("State: %v ", index.State)
str += fmt.Sprintf("Stream: %v ", index.Stream)
Expand Down

0 comments on commit 06410fa

Please sign in to comment.