File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -33,16 +33,16 @@ import (
3333
3434 "github.com/dgraph-io/badger"
3535 "github.com/dgraph-io/badger/options"
36- "github.com/dgraph-io/dgraph/gql"
3736 "github.com/dgraph-io/dgo/protos/api"
37+ "github.com/dgraph-io/dgo/y"
38+ "github.com/dgraph-io/dgraph/gql"
3839 "github.com/dgraph-io/dgraph/protos/intern"
3940 "github.com/dgraph-io/dgraph/query"
4041 "github.com/dgraph-io/dgraph/rdf"
4142 "github.com/dgraph-io/dgraph/schema"
4243 "github.com/dgraph-io/dgraph/types/facets"
4344 "github.com/dgraph-io/dgraph/worker"
4445 "github.com/dgraph-io/dgraph/x"
45- "github.com/dgraph-io/dgo/y"
4646 "github.com/pkg/errors"
4747)
4848
@@ -470,6 +470,9 @@ func (s *Server) CommitOrAbort(ctx context.Context, tc *api.TxnContext) (*api.Tx
470470
471471 tctx := & api.TxnContext {}
472472
473+ if tc .StartTs == 0 {
474+ return & api.TxnContext {}, fmt .Errorf ("StartTs cannot be zero while committing a transaction." )
475+ }
473476 commitTs , err := worker .CommitOverNetwork (ctx , tc )
474477 if err == y .ErrAborted {
475478 tctx .Aborted = true
You can’t perform that action at this time.
0 commit comments