Skip to content

Commit

Permalink
Small logic fixes for part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrjain committed Sep 28, 2017
1 parent ffd14f0 commit 3674b2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func NewKV(optParam *Options) (out *KV, err error) {
toLSM(t.nk, t.v)
}
txn = txn[:0]
lastCommit = 0

} else if e.Meta&BitTxn == 0 {
// This entry is from a rewrite.
Expand Down
3 changes: 2 additions & 1 deletion value.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (vlog *valueLog) rewrite(f *logFile) error {
elog.Printf("request has %d entries, size %d", len(wb), size)
batchSize := 1024
var loops int
for i := 0; i < len(wb); i += batchSize {
for i := 0; i < len(wb); {
loops++
if batchSize == 0 {
log.Printf("WARNING: We shouldn't reach batch size of zero.")
Expand All @@ -355,6 +355,7 @@ func (vlog *valueLog) rewrite(f *logFile) error {
}
return err
}
i += batchSize
}
elog.Printf("Processed %d entries in %d loops", len(wb), loops)

Expand Down

0 comments on commit 3674b2c

Please sign in to comment.