Skip to content

Commit a921026

Browse files
fixed reviews
1 parent 56e6664 commit a921026

5 files changed

Lines changed: 12 additions & 19 deletions

File tree

dgraph/cmd/zero/oracle.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Hypermode Inc. <[email protected]>
2+
* SPDX-FileCopyrightText: © Hypermode Inc. <[email protected]>
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -505,8 +505,7 @@ func (s *Server) Timestamps(ctx context.Context, num *pb.Num) (*pb.AssignedIds,
505505

506506
num.Type = pb.Num_TXN_TS
507507
reply, err := s.lease(ctx, num)
508-
span.SetAttributes(attribute.String("response", fmt.Sprintf("%+v", reply)))
509-
span.SetAttributes(attribute.String("error", fmt.Sprintf("%v", err)))
508+
span.AddEvent(fmt.Sprintf("Response: %+v, Error: %+v", reply, err))
510509

511510
switch err {
512511
case nil:

dgraph/cmd/zero/raft.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Hypermode Inc. <[email protected]>
2+
* SPDX-FileCopyrightText: © Hypermode Inc. <[email protected]>
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -1013,8 +1013,6 @@ func (n *node) Run() {
10131013
span.AddEvent("Advanced Raft")
10141014
timer.Record("advance")
10151015

1016-
span.SetAttributes(attribute.String("Zero.RunLoop", "Running"))
1017-
span.SetAttributes(attribute.String("Zero.RunLoop", "Done"))
10181016
span.End()
10191017
if timer.Total() > 5*tickDur {
10201018
glog.Warningf(

dgraph/cmd/zero/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Hypermode Inc. <[email protected]>
2+
* SPDX-FileCopyrightText: © Hypermode Inc. <[email protected]>
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

edgraph/server.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,15 +1440,13 @@ func processQuery(ctx context.Context, qc *queryContext) (*api.Response, error)
14401440
// Here we try our best effort to not contact Zero for a timestamp. If we succeed,
14411441
// then we use the max known transaction ts value (from ProcessDelta) for a read-only query.
14421442
// If we haven't processed any updates yet then fall back to getting TS from Zero.
1443-
if qc.span.IsRecording() {
1444-
switch {
1445-
case qc.req.BestEffort:
1446-
qc.span.AddEvent("", trace.WithAttributes(attribute.Bool("be", true)))
1447-
case qc.req.ReadOnly:
1448-
qc.span.AddEvent("", trace.WithAttributes(attribute.Bool("ro", true)))
1449-
default:
1450-
qc.span.AddEvent("", trace.WithAttributes(attribute.Bool("no", true)))
1451-
}
1443+
switch {
1444+
case qc.req.BestEffort:
1445+
qc.span.AddEvent("", trace.WithAttributes(attribute.Bool("be", true)))
1446+
case qc.req.ReadOnly:
1447+
qc.span.AddEvent("", trace.WithAttributes(attribute.Bool("ro", true)))
1448+
default:
1449+
qc.span.AddEvent("", trace.WithAttributes(attribute.Bool("no", true)))
14521450
}
14531451

14541452
if qc.req.BestEffort {

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/hypermodeinc/dgraph/v24
22

3-
go 1.23.0
4-
5-
toolchain go1.24.1
3+
go 1.23.6
64

75
require (
86
contrib.go.opencensus.io/exporter/prometheus v0.4.2

0 commit comments

Comments
 (0)