Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
59a852e4
Commit
59a852e4
authored
Jan 29, 2018
by
Martin Holst Swende
Committed by
Péter Szilágyi
Jan 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vendor: update leveldb to 211f780 (poolfix) (#15988)
parent
dd7a715d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
22 deletions
+27
-22
.travis.yml
vendor/github.com/syndtr/goleveldb/.travis.yml
+0
-12
README.md
vendor/github.com/syndtr/goleveldb/README.md
+3
-1
db.go
vendor/github.com/syndtr/goleveldb/leveldb/db.go
+12
-5
db_write.go
vendor/github.com/syndtr/goleveldb/leveldb/db_write.go
+9
-1
vendor.json
vendor/vendor.json
+3
-3
No files found.
vendor/github.com/syndtr/goleveldb/.travis.yml
deleted
100644 → 0
View file @
dd7a715d
language
:
go
go
:
-
1.4
-
1.5
-
1.6
-
1.7
-
tip
script
:
-
go test -timeout 1h ./...
-
go test -timeout 30m -race -run "TestDB_(Concurrent|GoleveldbIssue74)" ./leveldb
vendor/github.com/syndtr/goleveldb/README.md
View file @
59a852e4
...
@@ -10,13 +10,15 @@ Installation
...
@@ -10,13 +10,15 @@ Installation
Requirements
Requirements
-----------
-----------
*
Need at least
`go1.
4
`
or newer.
*
Need at least
`go1.
5
`
or newer.
Usage
Usage
-----------
-----------
Create or open a database:
Create or open a database:
```
go
```
go
// The returned DB instance is safe for concurrent use. Which mean that all
// DB's methods may be called concurrently from multiple goroutine.
db
,
err
:=
leveldb
.
OpenFile
(
"path/to/db"
,
nil
)
db
,
err
:=
leveldb
.
OpenFile
(
"path/to/db"
,
nil
)
...
...
defer
db
.
Close
()
defer
db
.
Close
()
...
...
vendor/github.com/syndtr/goleveldb/leveldb/db.go
View file @
59a852e4
...
@@ -32,6 +32,11 @@ type DB struct {
...
@@ -32,6 +32,11 @@ type DB struct {
// Need 64-bit alignment.
// Need 64-bit alignment.
seq
uint64
seq
uint64
// Stats. Need 64-bit alignment.
cWriteDelay
int64
// The cumulative duration of write delays
cWriteDelayN
int32
// The cumulative number of write delays
aliveSnaps
,
aliveIters
int32
// Session.
// Session.
s
*
session
s
*
session
...
@@ -49,9 +54,6 @@ type DB struct {
...
@@ -49,9 +54,6 @@ type DB struct {
snapsMu
sync
.
Mutex
snapsMu
sync
.
Mutex
snapsList
*
list
.
List
snapsList
*
list
.
List
// Stats.
aliveSnaps
,
aliveIters
int32
// Write.
// Write.
batchPool
sync
.
Pool
batchPool
sync
.
Pool
writeMergeC
chan
writeMerge
writeMergeC
chan
writeMerge
...
@@ -321,7 +323,7 @@ func recoverTable(s *session, o *opt.Options) error {
...
@@ -321,7 +323,7 @@ func recoverTable(s *session, o *opt.Options) error {
}
}
}
}
err
=
iter
.
Error
()
err
=
iter
.
Error
()
if
err
!=
nil
{
if
err
!=
nil
&&
!
errors
.
IsCorrupted
(
err
)
{
return
return
}
}
err
=
tw
.
Close
()
err
=
tw
.
Close
()
...
@@ -392,7 +394,7 @@ func recoverTable(s *session, o *opt.Options) error {
...
@@ -392,7 +394,7 @@ func recoverTable(s *session, o *opt.Options) error {
}
}
imax
=
append
(
imax
[
:
0
],
key
...
)
imax
=
append
(
imax
[
:
0
],
key
...
)
}
}
if
err
:=
iter
.
Error
();
err
!=
nil
{
if
err
:=
iter
.
Error
();
err
!=
nil
&&
!
errors
.
IsCorrupted
(
err
)
{
iter
.
Release
()
iter
.
Release
()
return
err
return
err
}
}
...
@@ -904,6 +906,8 @@ func (db *DB) GetSnapshot() (*Snapshot, error) {
...
@@ -904,6 +906,8 @@ func (db *DB) GetSnapshot() (*Snapshot, error) {
// Returns the number of files at level 'n'.
// Returns the number of files at level 'n'.
// leveldb.stats
// leveldb.stats
// Returns statistics of the underlying DB.
// Returns statistics of the underlying DB.
// leveldb.writedelay
// Returns cumulative write delay caused by compaction.
// leveldb.sstables
// leveldb.sstables
// Returns sstables list for each level.
// Returns sstables list for each level.
// leveldb.blockpool
// leveldb.blockpool
...
@@ -955,6 +959,9 @@ func (db *DB) GetProperty(name string) (value string, err error) {
...
@@ -955,6 +959,9 @@ func (db *DB) GetProperty(name string) (value string, err error) {
level
,
len
(
tables
),
float64
(
tables
.
size
())
/
1048576.0
,
duration
.
Seconds
(),
level
,
len
(
tables
),
float64
(
tables
.
size
())
/
1048576.0
,
duration
.
Seconds
(),
float64
(
read
)
/
1048576.0
,
float64
(
write
)
/
1048576.0
)
float64
(
read
)
/
1048576.0
,
float64
(
write
)
/
1048576.0
)
}
}
case
p
==
"writedelay"
:
writeDelayN
,
writeDelay
:=
atomic
.
LoadInt32
(
&
db
.
cWriteDelayN
),
time
.
Duration
(
atomic
.
LoadInt64
(
&
db
.
cWriteDelay
))
value
=
fmt
.
Sprintf
(
"DelayN:%d Delay:%s"
,
writeDelayN
,
writeDelay
)
case
p
==
"sstables"
:
case
p
==
"sstables"
:
for
level
,
tables
:=
range
v
.
levels
{
for
level
,
tables
:=
range
v
.
levels
{
value
+=
fmt
.
Sprintf
(
"--- level %d ---
\n
"
,
level
)
value
+=
fmt
.
Sprintf
(
"--- level %d ---
\n
"
,
level
)
...
...
vendor/github.com/syndtr/goleveldb/leveldb/db_write.go
View file @
59a852e4
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
package
leveldb
package
leveldb
import
(
import
(
"sync/atomic"
"time"
"time"
"github.com/syndtr/goleveldb/leveldb/memdb"
"github.com/syndtr/goleveldb/leveldb/memdb"
...
@@ -117,6 +118,8 @@ func (db *DB) flush(n int) (mdb *memDB, mdbFree int, err error) {
...
@@ -117,6 +118,8 @@ func (db *DB) flush(n int) (mdb *memDB, mdbFree int, err error) {
db
.
writeDelayN
++
db
.
writeDelayN
++
}
else
if
db
.
writeDelayN
>
0
{
}
else
if
db
.
writeDelayN
>
0
{
db
.
logf
(
"db@write was delayed N·%d T·%v"
,
db
.
writeDelayN
,
db
.
writeDelay
)
db
.
logf
(
"db@write was delayed N·%d T·%v"
,
db
.
writeDelayN
,
db
.
writeDelay
)
atomic
.
AddInt32
(
&
db
.
cWriteDelayN
,
int32
(
db
.
writeDelayN
))
atomic
.
AddInt64
(
&
db
.
cWriteDelay
,
int64
(
db
.
writeDelay
))
db
.
writeDelay
=
0
db
.
writeDelay
=
0
db
.
writeDelayN
=
0
db
.
writeDelayN
=
0
}
}
...
@@ -143,7 +146,7 @@ func (db *DB) unlockWrite(overflow bool, merged int, err error) {
...
@@ -143,7 +146,7 @@ func (db *DB) unlockWrite(overflow bool, merged int, err error) {
}
}
}
}
// ourBatch i
f defined should equal with batch
.
// ourBatch i
s batch that we can modify
.
func
(
db
*
DB
)
writeLocked
(
batch
,
ourBatch
*
Batch
,
merge
,
sync
bool
)
error
{
func
(
db
*
DB
)
writeLocked
(
batch
,
ourBatch
*
Batch
,
merge
,
sync
bool
)
error
{
// Try to flush memdb. This method would also trying to throttle writes
// Try to flush memdb. This method would also trying to throttle writes
// if it is too fast and compaction cannot catch-up.
// if it is too fast and compaction cannot catch-up.
...
@@ -212,6 +215,11 @@ func (db *DB) writeLocked(batch, ourBatch *Batch, merge, sync bool) error {
...
@@ -212,6 +215,11 @@ func (db *DB) writeLocked(batch, ourBatch *Batch, merge, sync bool) error {
}
}
}
}
// Release ourBatch if any.
if
ourBatch
!=
nil
{
defer
db
.
batchPool
.
Put
(
ourBatch
)
}
// Seq number.
// Seq number.
seq
:=
db
.
seq
+
1
seq
:=
db
.
seq
+
1
...
...
vendor/vendor.json
View file @
59a852e4
...
@@ -394,10 +394,10 @@
...
@@ -394,10 +394,10 @@
"revisionTime"
:
"2017-07-05T02:17:15Z"
"revisionTime"
:
"2017-07-05T02:17:15Z"
},
},
{
{
"checksumSHA1"
:
"
yHbyLpI/Meh0DGrmi8x6FrDxxUY
="
,
"checksumSHA1"
:
"
rpu5ZHjXlV13UKA7L1d5MTOyQwA
="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb"
,
"path"
:
"github.com/syndtr/goleveldb/leveldb"
,
"revision"
:
"
b89cc31ef7977104127d34c1bd31ebd1a9db2199
"
,
"revision"
:
"
211f780988068502fe874c44dae530528ebd840f
"
,
"revisionTime"
:
"201
7-07-25T06:48:3
6Z"
"revisionTime"
:
"201
8-01-28T14:04:1
6Z"
},
},
{
{
"checksumSHA1"
:
"EKIow7XkgNdWvR/982ffIZxKG8Y="
,
"checksumSHA1"
:
"EKIow7XkgNdWvR/982ffIZxKG8Y="
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment