# How to minimalize \`Transaction is too old\`

**URL:** https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853
**Category:** Dgraph
**Created:** [July 4, 2018, 6:47pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853 "2018-07-04T18:47:40Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![selmeci](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@selmeci](https://discuss.dgraph.io/u/selmeci)
#### Post date: [July 4, 2018, 6:47pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/1 "2018-07-04T18:47:40Z")

</div>

Hi,

is it possible to minimalize this kind of error - Transaction is too old?

I do several concurrent transaction with JavaScript client. (parallel = 10).  
I can handle it and repeat request, but I’m curious and want to improve performance.

If it is possible, how to do it?

---

<div class="post-metadata">

### Author: ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)
#### Post date: [July 4, 2018, 8:46pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/2 "2018-07-04T20:46:53Z")

</div>

are u using commit or commit now?

---

<div class="post-metadata">

### Author: ![selmeci](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@selmeci](https://discuss.dgraph.io/u/selmeci)
#### Post date: [July 5, 2018, 6:51am UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/3 "2018-07-05T06:51:39Z")

</div>

I use only commit like in [JS doc](https://github.com/dgraph-io/dgraph-js#commit-a-transaction)

---

<div class="post-metadata">

### Author: ![selmeci](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@selmeci](https://discuss.dgraph.io/u/selmeci)
#### Post date: [July 5, 2018, 8:53am UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/4 "2018-07-05T08:53:09Z")

</div>

I found this option in code. It little help, but I still get this errors.

Why and when transaction is old?

---

<div class="post-metadata">

### Author: ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)
#### Post date: [July 5, 2018, 3:33pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/5 "2018-07-05T15:33:22Z")

</div>

Well, if you’re doing like in the documentation. I have no idea what it is. But maybe it can be the clock? Are your instances in sync?

---

<div class="post-metadata">

### Author: ![selmeci](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@selmeci](https://discuss.dgraph.io/u/selmeci)
#### Post date: [July 5, 2018, 8:50pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/6 "2018-07-05T20:50:53Z")

</div>

Right now, I’m testing on cluster with one **zero** and one **server** which runs in AWS eu-west-1 zone. My PC time is sync according to NTP server.

---

<div class="post-metadata">

### Author: ![mrjn](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/mrjn/32/775_2.png) [@mrjn](https://discuss.dgraph.io/u/mrjn)
#### Post date: [July 5, 2018, 9:13pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/7 "2018-07-05T21:13:47Z")

</div>

Are you seeing them once in a while, and on a repeat they go away, or they just continue to happen indefinitely? When mutations are happening, and we discard older versions, then if a txn tries to read the older version, we tell it to retry. That’s what’s happening here.

---

<div class="post-metadata">

### Author: ![selmeci](https://avatars.discourse-cdn.com/v4/letter/s/ecb155/32.png) [@selmeci](https://discuss.dgraph.io/u/selmeci)
#### Post date: [July 6, 2018, 2:57pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/8 "2018-07-06T14:57:31Z")

</div>

Hmm, ok it is reasonable.

I would like to use dGraph with AWS Lambda.  
During my test I got another error: `Error: 13 INTERNAL: GOAWAY received`.  
Is there any limit on how many clients can connect or what this error mean?

---

<div class="post-metadata">

### Author: ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)
#### Post date: [July 6, 2018, 4:04pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/9 "2018-07-06T16:04:42Z")

</div>

This can be related to [Ping from client breaks connection with "too many pings" message. Possibly related to bug in gRPC v1.8.2 · Issue #2444 · dgraph-io/dgraph · GitHub](https://github.com/dgraph-io/dgraph/issues/2444)

Is a gRPC thing.

[https://github.com/grpc/grpc/search?q=GOAWAY&unscoped\_q=GOAWAY](https://github.com/grpc/grpc/search?q=GOAWAY&unscoped_q=GOAWAY)

GOAWAY Frame [grpc/doc/PROTOCOL-HTTP2.md at 0897bef6b0f8589eefa3f18444b1da58884c25d6 · grpc/grpc · GitHub](https://github.com/grpc/grpc/blob/0897bef6b0f8589eefa3f18444b1da58884c25d6/doc/PROTOCOL-HTTP2.md#goaway-frame)

Sent by servers to clients to indicate that they will no longer accept any new streams on the associated connections. This frame includes the id of the last successfully accepted stream by the server. Clients should consider any stream initiated after the last successfully accepted stream as UNAVAILABLE and retry the call elsewhere. Clients are free to continue working with the already accepted streams until they complete or the connection is terminated.

Servers should send GOAWAY before terminating a connection to reliably inform clients which work has been accepted by the server and is being executed.

---

<div class="post-metadata">

### Author: ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)
#### Post date: [July 6, 2018, 4:07pm UTC](https://discuss.dgraph.io/t/how-to-minimalize-transaction-is-too-old/2853/10 "2018-07-06T16:07:07Z")

</div>

There’s other option for JS.

> **[GitHub - dgraph-io/dgraph-js-http: A JavaScript HTTP client for Dgraph](https://github.com/dgraph-io/dgraph-js-http)**
>
> A JavaScript HTTP client for Dgraph. Contribute to dgraph-io/dgraph-js-http development by creating an account on GitHub.
