Skip to content

Commit

Permalink
chore: fix some comments (#2092)
Browse files Browse the repository at this point in the history
<!--
 Change Github PR Title 

 Your title must be in the following format: 
 - `topic(Area): Feature`
- `Topic` must be one of
`build|ci|docs|feat|fix|perf|refactor|chore|test`

 Sample Titles:
 - `feat(Enterprise)`: Backups can now get credentials from IAM
 - `fix(Query)`: Skipping floats that cannot be Marshalled in JSON
 - `perf: [Breaking]` json encoding is now 35% faster if SIMD is present
 - `chore`: all chores/tests will be excluded from the CHANGELOG
 -->

## Problem

fix some comments


 <!--
 Please add a description with these things:
 1. Explain the problem by providing a good description.
 2. If it fixes any GitHub issues, say "Fixes #GitHubIssue".
 3. If it corresponds to a Jira issue, say "Fixes DGRAPH-###".
4. If this is a breaking change, please prefix `[Breaking]` in the
title. In the description, please put a note with exactly who these
changes are breaking for.
 -->

## Solution
 <!--
 Please add a description with these things:
 1. Explain the solution to make it easier to review the PR.
2. Make it easier for the reviewer by describing complex sections with
comments.
 -->

Signed-off-by: dufucun <dufuchun@sohu.com>
  • Loading branch information
dufucun committed Aug 28, 2024
1 parent 70ab90f commit 2725dc8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func checkAndSetOptions(opt *Options) error {
"reduce opt.ValueThreshold or increase opt.BaseTableSize.",
opt.ValueThreshold, opt.maxBatchSize)
}
// ValueLogFileSize should be stricly LESS than 2<<30 otherwise we will
// ValueLogFileSize should be strictly LESS than 2<<30 otherwise we will
// overflow the uint32 when we mmap it in OpenMemtable.
if !(opt.ValueLogFileSize < 2<<30 && opt.ValueLogFileSize >= 1<<20) {
return ErrValueLogSize
Expand Down Expand Up @@ -403,7 +403,7 @@ func Open(opt Options) (*DB, error) {
return db, nil
}

// initBannedNamespaces retrieves the banned namepsaces from the DB and updates in-memory structure.
// initBannedNamespaces retrieves the banned namespaces from the DB and updates in-memory structure.
func (db *DB) initBannedNamespaces() error {
if db.opt.NamespaceOffset < 0 {
return nil
Expand Down Expand Up @@ -905,7 +905,7 @@ func (db *DB) sendToWriteCh(entries []*Entry) (*request, error) {
return nil, ErrTxnTooBig
}

// We can only service one request because we need each txn to be stored in a contigous section.
// We can only service one request because we need each txn to be stored in a contiguous section.
// Txns should not interleave among other txns or rewrites.
req := requestPool.Get().(*request)
req.reset()
Expand Down Expand Up @@ -1710,7 +1710,7 @@ func (db *DB) dropAll() (func(), error) {
if err != nil {
return f, err
}
// prepareToDrop will stop all the incomming write and flushes any pending memtables.
// prepareToDrop will stop all the incoming write and flushes any pending memtables.
// Before we drop, we'll stop the compaction because anyways all the datas are going to
// be deleted.
db.stopCompactions()
Expand Down Expand Up @@ -1753,7 +1753,7 @@ func (db *DB) dropAll() (func(), error) {

// DropPrefix would drop all the keys with the provided prefix. It does this in the following way:
// - Stop accepting new writes.
// - Stop memtable flushes before acquiring lock. Because we're acquring lock here
// - Stop memtable flushes before acquiring lock. Because we're acquiring lock here
// and memtable flush stalls for lock, which leads to deadlock
// - Flush out all memtables, skipping over keys with the given prefix, Kp.
// - Write out the value log header to memtables when flushing, so we don't accidentally bring Kp
Expand Down

0 comments on commit 2725dc8

Please sign in to comment.