Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove LinRead map logic from Dgraph #2570

Merged
merged 3 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions contrib/integration/bank/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

var (
users = flag.Int("users", 100, "Number of accounts.")
conc = flag.Int("txns", 10, "Number of concurrent transactions.")
conc = flag.Int("txns", 3, "Number of concurrent transactions per client.")
dur = flag.String("dur", "1m", "How long to run the transactions.")
addr = flag.String("addr", "localhost:9080", "Address of Dgraph server.")
verbose = flag.Bool("verbose", true, "Output all logs in verbose mode.")
Expand Down Expand Up @@ -75,7 +75,6 @@ func (s *State) createAccounts(dg *dgo.Dgraph) {
x.Check(err)

txn := dg.NewTxn()
txn.Sequencing(api.LinRead_SERVER_SIDE)
defer txn.Discard(context.Background())
var mu api.Mutation
mu.SetJson = data
Expand All @@ -98,7 +97,6 @@ func (s *State) runTotal(dg *dgo.Dgraph) error {
}
`
txn := dg.NewTxn()
txn.Sequencing(api.LinRead_SERVER_SIDE)
defer txn.Discard(context.Background())
resp, err := txn.Query(context.Background(), query)
if err != nil {
Expand Down Expand Up @@ -166,7 +164,6 @@ func (s *State) runTransaction(dg *dgo.Dgraph, buf *bytes.Buffer) error {

ctx := context.Background()
txn := dg.NewTxn()
txn.Sequencing(api.LinRead_SERVER_SIDE)
defer txn.Discard(ctx)

var sk, sd int
Expand Down Expand Up @@ -305,9 +302,11 @@ func main() {
s.createAccounts(clients[0])

var wg sync.WaitGroup
for _, dg := range clients {
wg.Add(1)
go s.loop(dg, &wg)
for i := 0; i < *conc; i++ {
for _, dg := range clients {
wg.Add(1)
go s.loop(dg, &wg)
}
}
wg.Wait()
fmt.Println()
Expand Down
13 changes: 0 additions & 13 deletions dgraph/cmd/server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,6 @@ func queryHandler(w http.ResponseWriter, r *http.Request) {
}
req.StartTs = ts

linRead := r.Header.Get("X-Dgraph-LinRead")
if linRead != "" {
lr := make(map[uint32]uint64)
if err := json.Unmarshal([]byte(linRead), &lr); err != nil {
x.SetStatus(w, x.ErrorInvalidRequest,
"Error while unmarshalling LinRead header into map")
return
}
req.LinRead = &api.LinRead{
Ids: lr,
}
}

if vars := r.Header.Get("X-Dgraph-Vars"); vars != "" {
req.Vars = map[string]string{}
if err := json.Unmarshal([]byte(vars), &req.Vars); err != nil {
Expand Down
2 changes: 0 additions & 2 deletions edgraph/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ func (s *Server) Query(ctx context.Context, req *api.Request) (resp *api.Respons
Latency: &l,
GqlQuery: &parsedReq,
ReadTs: req.StartTs,
LinRead: req.LinRead,
}

// Core processing happens here.
Expand Down Expand Up @@ -490,7 +489,6 @@ func (s *Server) Query(ctx context.Context, req *api.Request) (resp *api.Respons
}

resp.Latency = gl
resp.Txn.LinRead = queryRequest.LinRead
return resp, err
}

Expand Down
Loading