Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dgraph
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
dgraph
Commits
c54bf33a
Commit
c54bf33a
authored
9 years ago
by
Manish R Jain
Browse files
Options
Downloads
Patches
Plain Diff
Fix a bug due to which we were unable to retrieve xids.
parent
62b6b8fd
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
query/query.go
+8
-1
8 additions, 1 deletion
query/query.go
tools/dlist/main.go
+3
-0
3 additions, 0 deletions
tools/dlist/main.go
worker/task.go
+6
-1
6 additions, 1 deletion
worker/task.go
worker/worker.go
+3
-2
3 additions, 2 deletions
worker/worker.go
with
20 additions
and
4 deletions
query/query.go
+
8
−
1
View file @
c54bf33a
...
...
@@ -403,7 +403,6 @@ func sortedUniqueUids(r *task.Result) (sorted []uint64, rerr error) {
func
ProcessGraph
(
sg
*
SubGraph
,
rch
chan
error
)
{
var
err
error
if
len
(
sg
.
query
)
>
0
&&
sg
.
Attr
!=
"_root_"
{
// This task execution would go over the wire in later versions.
sg
.
result
,
err
=
worker
.
ProcessTaskOverNetwork
(
sg
.
query
)
if
err
!=
nil
{
x
.
Err
(
glog
,
err
)
.
Error
(
"While processing task."
)
...
...
@@ -416,6 +415,14 @@ func ProcessGraph(sg *SubGraph, rch chan error) {
r
:=
new
(
task
.
Result
)
r
.
Init
(
sg
.
result
,
uo
)
if
r
.
ValuesLength
()
>
0
{
var
v
task
.
Value
if
r
.
Values
(
&
v
,
0
)
{
glog
.
WithField
(
"attr"
,
sg
.
Attr
)
.
WithField
(
"val"
,
string
(
v
.
ValBytes
()))
.
Info
(
"Sample value"
)
}
}
sorted
,
err
:=
sortedUniqueUids
(
r
)
if
err
!=
nil
{
x
.
Err
(
glog
,
err
)
.
Error
(
"While processing task."
)
...
...
This diff is collapsed.
Click to expand it.
tools/dlist/main.go
+
3
−
0
View file @
c54bf33a
...
...
@@ -101,5 +101,8 @@ func main() {
if
err
!=
nil
{
glog
.
WithError
(
err
)
.
Fatal
(
"Unable to get key"
)
}
if
len
(
val
)
==
0
{
glog
.
Fatal
(
"Unable to find posting list"
)
}
output
(
val
)
}
This diff is collapsed.
Click to expand it.
worker/task.go
+
6
−
1
View file @
c54bf33a
...
...
@@ -51,7 +51,12 @@ func processTask(query []byte) (result []byte, rerr error) {
uo
:=
flatbuffers
.
GetUOffsetT
(
query
)
q
:=
new
(
task
.
Query
)
q
.
Init
(
query
,
uo
)
attr
:=
string
(
q
.
Attr
())
store
:=
dataStore
if
attr
==
"_xid_"
{
store
=
uidStore
}
b
:=
flatbuffers
.
NewBuilder
(
0
)
voffsets
:=
make
([]
flatbuffers
.
UOffsetT
,
q
.
UidsLength
())
...
...
@@ -60,7 +65,7 @@ func processTask(query []byte) (result []byte, rerr error) {
for
i
:=
0
;
i
<
q
.
UidsLength
();
i
++
{
uid
:=
q
.
Uids
(
i
)
key
:=
posting
.
Key
(
uid
,
attr
)
pl
:=
posting
.
GetOrCreate
(
key
,
dataS
tore
)
pl
:=
posting
.
GetOrCreate
(
key
,
s
tore
)
var
valoffset
flatbuffers
.
UOffsetT
if
val
,
err
:=
pl
.
Value
();
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
worker/worker.go
+
3
−
2
View file @
c54bf33a
...
...
@@ -126,9 +126,10 @@ func (w *Worker) ServeTask(query *conn.Query, reply *conn.Reply) (rerr error) {
q
:=
new
(
task
.
Query
)
q
.
Init
(
query
.
Data
,
uo
)
attr
:=
string
(
q
.
Attr
())
glog
.
WithField
(
"attr"
,
attr
)
.
WithField
(
"instanceIdx"
,
instanceIdx
)
.
Info
(
"ServeTask"
)
glog
.
WithField
(
"attr"
,
attr
)
.
WithField
(
"num_uids"
,
q
.
UidsLength
())
.
WithField
(
"instanceIdx"
,
instanceIdx
)
.
Info
(
"ServeTask"
)
if
attr
==
"_xid_"
||
if
(
instanceIdx
==
0
&&
attr
==
"_xid_"
)
||
farm
.
Fingerprint64
([]
byte
(
attr
))
%
numInstances
==
instanceIdx
{
reply
.
Data
,
rerr
=
processTask
(
query
.
Data
)
...
...
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