Merge pull request #11734 from jingyih/automated-cherry-pick-of-#11330-upstream-release-3.4

Cherry pick of #11330 on release-3.4
This commit is contained in:
Gyuho Lee 2020-03-31 14:58:59 -07:00 committed by GitHub
commit 857dffa386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -271,15 +271,15 @@ func (s *store) updateCompactRev(rev int64) (<-chan struct{}, error) {
}
func (s *store) compact(trace *traceutil.Trace, rev int64) (<-chan struct{}, error) {
start := time.Now()
keep := s.kvindex.Compact(rev)
trace.Step("compact in-memory index tree")
ch := make(chan struct{})
var j = func(ctx context.Context) {
if ctx.Err() != nil {
s.compactBarrier(ctx, ch)
return
}
start := time.Now()
keep := s.kvindex.Compact(rev)
indexCompactionPauseMs.Observe(float64(time.Since(start) / time.Millisecond))
if !s.scheduleCompaction(rev, keep) {
s.compactBarrier(nil, ch)
return
@ -288,8 +288,6 @@ func (s *store) compact(trace *traceutil.Trace, rev int64) (<-chan struct{}, err
}
s.fifoSched.Schedule(j)
indexCompactionPauseMs.Observe(float64(time.Since(start) / time.Millisecond))
trace.Step("schedule compaction")
return ch, nil
}

2
test
View File

@ -581,7 +581,7 @@ function receiver_name_pass {
}
function commit_title_pass {
git log --oneline "$(git merge-base HEAD master)"...HEAD | while read -r l; do
git log --oneline "$(git merge-base HEAD "$(git rev-parse --abbrev-ref --symbolic-full-name "@{u}")")"...HEAD | while read -r l; do
commitMsg=$(echo "$l" | cut -f2- -d' ')
if [[ "$commitMsg" == Merge* ]]; then
# ignore "Merge pull" commits