Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210310676
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210310676
Commits
5ccf0c3d
Commit
5ccf0c3d
authored
4 years ago
by
Xiangyu Wang
Committed by
yefu.chen
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add log for segment row estimate
Signed-off-by:
Xiangyu Wang
<
xiangyu.wang@zilliz.com
>
parent
3ab8b9af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
internal/dataservice/segment_allocator.go
+13
-0
13 additions, 0 deletions
internal/dataservice/segment_allocator.go
with
13 additions
and
0 deletions
internal/dataservice/segment_allocator.go
+
13
−
0
View file @
5ccf0c3d
...
...
@@ -7,6 +7,9 @@ import (
"sync"
"time"
"go.uber.org/zap"
"github.com/zilliztech/milvus-distributed/internal/log"
"github.com/zilliztech/milvus-distributed/internal/util/trace"
"github.com/zilliztech/milvus-distributed/internal/util/tsoutil"
"github.com/zilliztech/milvus-distributed/internal/util/typeutil"
...
...
@@ -94,6 +97,10 @@ func (allocator *segmentAllocator) OpenSegment(ctx context.Context, segmentInfo
if
err
!=
nil
{
return
err
}
log
.
Debug
(
"dataservice: estimateTotalRows: "
,
zap
.
Int64
(
"CollectionID"
,
segmentInfo
.
CollectionID
),
zap
.
Int64
(
"SegmentID"
,
segmentInfo
.
SegmentID
),
zap
.
Int
(
"Rows"
,
totalRows
))
allocator
.
segments
[
segmentInfo
.
SegmentID
]
=
&
segmentStatus
{
id
:
segmentInfo
.
SegmentID
,
collectionID
:
segmentInfo
.
CollectionID
,
...
...
@@ -146,6 +153,9 @@ func (allocator *segmentAllocator) alloc(segStatus *segmentStatus, numRows int)
return
false
,
err
}
free
:=
segStatus
.
total
-
int
(
segMeta
.
NumRows
)
-
totalOfAllocations
log
.
Debug
(
"dataservice::alloc: "
,
zap
.
Any
(
"segMeta.NumRows"
,
int
(
segMeta
.
NumRows
)),
zap
.
Any
(
"totalOfAllocations"
,
totalOfAllocations
))
if
numRows
>
free
{
return
false
,
nil
}
...
...
@@ -238,6 +248,9 @@ func (allocator *segmentAllocator) ExpireAllocations(ctx context.Context, timeTi
if
timeTick
<
segStatus
.
allocations
[
i
]
.
expireTime
{
continue
}
log
.
Debug
(
"dataservice::ExpireAllocations: "
,
zap
.
Any
(
"segStatus.id"
,
segStatus
.
id
),
zap
.
Any
(
"segStatus.allocations.rowNums"
,
segStatus
.
allocations
[
i
]
.
rowNums
))
segStatus
.
allocations
=
append
(
segStatus
.
allocations
[
:
i
],
segStatus
.
allocations
[
i
+
1
:
]
...
)
i
--
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment