Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
99036f9c
Commit
99036f9c
authored
Mar 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
49434236
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
go/zodb/db.go
go/zodb/db.go
+1
-4
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+5
-5
No files found.
go/zodb/db.go
View file @
99036f9c
...
@@ -382,14 +382,11 @@ func (db *DB) Open(ctx context.Context, opt *ConnOptions) (_ *Connection, err er
...
@@ -382,14 +382,11 @@ func (db *DB) Open(ctx context.Context, opt *ConnOptions) (_ *Connection, err er
at
=
db
.
δtail
.
Head
()
at
=
db
.
δtail
.
Head
()
db
.
mu
.
Unlock
()
db
.
mu
.
Unlock
()
}
else
{
}
else
{
// sync storage for lastTid
// sync storage for head
var
err
error
err
=
db
.
stor
.
Sync
(
ctx
)
err
=
db
.
stor
.
Sync
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
at
=
db
.
stor
.
Head
()
at
=
db
.
stor
.
Head
()
}
}
}
}
...
...
go/zodb/storage/fs1/filestorage_test.go
View file @
99036f9c
...
@@ -462,7 +462,7 @@ func TestOpenRecovery(t *testing.T) {
...
@@ -462,7 +462,7 @@ func TestOpenRecovery(t *testing.T) {
X
:=
exc
.
Raiseif
X
:=
exc
.
Raiseif
main
,
err
:=
ioutil
.
ReadFile
(
"testdata/1.fs"
);
X
(
err
)
main
,
err
:=
ioutil
.
ReadFile
(
"testdata/1.fs"
);
X
(
err
)
index
,
err
:=
ioutil
.
ReadFile
(
"testdata/1.fs.index"
);
X
(
err
)
index
,
err
:=
ioutil
.
ReadFile
(
"testdata/1.fs.index"
);
X
(
err
)
lastTi
dOk
:=
_1fs_dbEntryv
[
len
(
_1fs_dbEntryv
)
-
1
]
.
Header
.
Tid
hea
dOk
:=
_1fs_dbEntryv
[
len
(
_1fs_dbEntryv
)
-
1
]
.
Header
.
Tid
topPos
:=
int64
(
_1fs_indexTopPos
)
topPos
:=
int64
(
_1fs_indexTopPos
)
voteTail
,
err
:=
ioutil
.
ReadFile
(
"testdata/1voted.tail"
);
X
(
err
)
voteTail
,
err
:=
ioutil
.
ReadFile
(
"testdata/1voted.tail"
);
X
(
err
)
...
@@ -495,12 +495,12 @@ func TestOpenRecovery(t *testing.T) {
...
@@ -495,12 +495,12 @@ func TestOpenRecovery(t *testing.T) {
defer
func
()
{
defer
func
()
{
err
=
fs
.
Close
();
X
(
err
)
err
=
fs
.
Close
();
X
(
err
)
}()
}()
if
at0
!=
lastTi
dOk
{
if
at0
!=
hea
dOk
{
t
.
Fatalf
(
"at0: %s ; expected: %s"
,
at0
,
lastTi
dOk
)
t
.
Fatalf
(
"at0: %s ; expected: %s"
,
at0
,
hea
dOk
)
}
}
head
,
err
:=
fs
.
Sync
(
ctx
);
X
(
err
)
head
,
err
:=
fs
.
Sync
(
ctx
);
X
(
err
)
if
head
!=
lastTi
dOk
{
if
head
!=
hea
dOk
{
t
.
Fatalf
(
"head: %s ; expected: %s"
,
head
,
lastTi
dOk
)
t
.
Fatalf
(
"head: %s ; expected: %s"
,
head
,
hea
dOk
)
}
}
})
})
}
}
...
...
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