Skip to content

Commit

Permalink
MB-38083 improve scan setup time
Browse files Browse the repository at this point in the history
Change-Id: If6d65aad2df03ac29e6786568e0d6039025ce39e
  • Loading branch information
marcogrecopriolo committed Jun 6, 2020
1 parent 82fc315 commit 855ec9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
8 changes: 3 additions & 5 deletions secondary/queryport/client/meta_client.go
Expand Up @@ -233,8 +233,7 @@ RETRY:
secExprs, desc, isPrimary, scheme, partitionKeys, plan)

if needRefresh && refreshCnt == 0 {
fmsg := "GsiClient: Indexer Node List is out-of-date. Require refresh."
logging.Debugf(fmsg)
logging.Debugf("GsiClient: Indexer Node List is out-of-date. Require refresh.")
if err := b.updateIndexerList(false); err != nil {
logging.Errorf("updateIndexerList(): %v\n", err)
return uint64(defnID), err
Expand Down Expand Up @@ -354,7 +353,7 @@ func (b *metadataClient) GetScanport(defnID uint64, excludes map[common.IndexDef
return nil, 0, nil, nil, nil, 0, false
}

var replicas [128]uint64
replicas := make([]uint64, len(currmeta.replicas[common.IndexDefnId(defnID)]))
n := 0
for _, replicaID := range currmeta.replicas[common.IndexDefnId(defnID)] {
replicas[n] = uint64(replicaID)
Expand Down Expand Up @@ -417,8 +416,7 @@ func (b *metadataClient) GetScanport(defnID uint64, excludes map[common.IndexDef
}
}

fmsg := "Scan port %s for index defnID %d of equivalent index defnId %d"
logging.Debugf(fmsg, qp, targetDefnID, defnID)
logging.Debugf("Scan port %s for index defnID %d of equivalent index defnId %d", qp, targetDefnID, defnID)
return qp, targetDefnID, in, rt, pid, numPartitions, true
}

Expand Down
6 changes: 2 additions & 4 deletions secondary/queryport/client/scan_client.go
Expand Up @@ -1341,8 +1341,7 @@ func (c *GsiScanClient) streamResponse(

} else if resp == nil {
finish = true
fmsg := "%v req(%v) connection %q received StreamEndResponse"
logging.Tracef(fmsg, c.logPrefix, requestId, laddr)
logging.Tracef("%v req(%v) connection %q received StreamEndResponse", c.logPrefix, requestId, laddr)
callb(&protobuf.StreamEndResponse{}) // callback most likely return true
cont, healthy = false, true

Expand Down Expand Up @@ -1376,8 +1375,7 @@ func (c *GsiScanClient) closeStream(
return
}

fmsg := "%v req(%v) connection %q transmitted protobuf.EndStreamRequest"
logging.Tracef(fmsg, c.logPrefix, requestId, laddr)
logging.Tracef("%v req(%v) connection %q transmitted protobuf.EndStreamRequest", c.logPrefix, requestId, laddr)

// flush the connection until stream has ended.
for true {
Expand Down
5 changes: 2 additions & 3 deletions secondary/queryport/n1ql/secondary_index.go
Expand Up @@ -1647,8 +1647,7 @@ func makeResponsehandler(
atomic.AddInt64(&backfillEntries, 1)

} else {
fmsg := "%v response cap:%v len:%v entries:%v\n"
l.Tracef(fmsg, lprefix, cp, ln, skeys.GetLength())
l.Tracef("%v response cap:%v len:%v entries:%v\n", lprefix, cp, ln, skeys.GetLength())
if primed == false {
atomic.AddInt64(&si.gsi.primedur, int64(time.Since(starttm)))
primed = true
Expand Down Expand Up @@ -1808,7 +1807,7 @@ func string2defnID(id string) uint64 {
}

func vector2ts(vector timestamp.Vector) *qclient.TsConsistency {
if vector == nil {
if vector == nil || len(vector.Entries()) == 0 {
return nil
}
vbnos := make([]uint16, 0, 1024)
Expand Down

0 comments on commit 855ec9e

Please sign in to comment.