Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asapo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joao Alvim Oliveira Dias De Almeida
asapo
Commits
b66951ab
Commit
b66951ab
authored
6 years ago
by
Sergey Yakubov
Browse files
Options
Downloads
Patches
Plain Diff
remove journal write concern from broker
parent
3828e1db
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
broker/src/asapo_broker/database/mongodb.go
+12
-1
12 additions, 1 deletion
broker/src/asapo_broker/database/mongodb.go
tests/automatic/broker/check_mongo_restart/check_linux.sh
+2
-1
2 additions, 1 deletion
tests/automatic/broker/check_mongo_restart/check_linux.sh
with
14 additions
and
2 deletions
broker/src/asapo_broker/database/mongodb.go
+
12
−
1
View file @
b66951ab
...
...
@@ -3,11 +3,13 @@
package
database
import
(
"asapo_common/logger"
"asapo_common/utils"
"encoding/json"
"errors"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
"strconv"
"sync"
"time"
)
...
...
@@ -80,7 +82,8 @@ func (db *Mongodb) Connect(address string) (err error) {
if
err
!=
nil
{
return
err
}
db
.
session
.
SetSafe
(
&
mgo
.
Safe
{
J
:
true
})
// db.session.SetSafe(&mgo.Safe{J: true})
if
err
:=
db
.
updateDatabaseList
();
err
!=
nil
{
return
err
...
...
@@ -162,9 +165,13 @@ func (db *Mongodb) GetRecordByID(dbname string, id int) ([]byte, error) {
Id
int
`json:"id""`
}{
id
}
res
,
_
:=
json
.
Marshal
(
&
r
)
log_str
:=
"error getting record id "
+
strconv
.
Itoa
(
id
)
+
" for "
+
dbname
+
" : "
+
err
.
Error
()
logger
.
Debug
(
log_str
)
return
nil
,
&
DBError
{
utils
.
StatusNoData
,
string
(
res
)}
}
log_str
:=
"got record id "
+
strconv
.
Itoa
(
id
)
+
" for "
+
dbname
logger
.
Debug
(
log_str
)
return
utils
.
MapToJson
(
&
res
)
}
...
...
@@ -235,8 +242,12 @@ func (db *Mongodb) GetNextRecord(db_name string) ([]byte, error) {
curPointer
,
err
:=
db
.
getCurrentPointer
(
db_name
)
if
err
!=
nil
{
log_str
:=
"error getting next pointer for "
+
db_name
+
":"
+
err
.
Error
()
logger
.
Debug
(
log_str
)
return
nil
,
err
}
log_str
:=
"got next pointer "
+
strconv
.
Itoa
(
curPointer
.
Value
)
+
" for "
+
db_name
logger
.
Debug
(
log_str
)
return
db
.
GetRecordByID
(
db_name
,
curPointer
.
Value
)
}
This diff is collapsed.
Click to expand it.
tests/automatic/broker/check_mongo_restart/check_linux.sh
+
2
−
1
View file @
b66951ab
...
...
@@ -93,5 +93,6 @@ start_mongo
wait
cat
output.txt
cat
output.txt |
grep
"Processed 1000 file(s)"
nfiles
=
`
cat
output.txt |
grep
"Processed"
|
awk
'{print $2;}'
`
test
$nfiles
-ge
1000
rm
output.txt
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment