# Value\_too\_large on reads?

**URL:** <https://forums.foundationdb.org/t/value-too-large-on-reads/615>\
**Category:** Using FoundationDB\
**Created:** [August 8, 2018, 12:15am UTC](https://forums.foundationdb.org/t/value-too-large-on-reads/615 "2018-08-08T00:15:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![panghy](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/panghy/32/19_2.png) [@panghy](https://forums.foundationdb.org/u/panghy)\
**Post date:** [August 8, 2018, 12:15am UTC](https://forums.foundationdb.org/t/value-too-large-on-reads/615/1 "2018-08-08T00:15:00Z")

</div>

We seem to see that just with doing range gets, if we get to rows with large values, we get value\_too\_large exceptions, basically along the lines of:

```
Causing: com.foundationdb.FDBException: value_too_large
! at com.foundationdb.FDBException.retargetClone(FDBException.java:41)
! at com.foundationdb.async.SettableFuture.getIfDone(SettableFuture.java:188)
! at com.foundationdb.async.AbstractFuture.get(AbstractFuture.java:28)
! at com.foundationdb.RangeQuery$AsyncRangeIterator.hasNext(RangeQuery.java:262)

```

Given that this is a read, is there something that allowed the write but actually failed on the read?

---

<div class="post-metadata">

**Author:** ![panghy](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/panghy/32/19_2.png) [@panghy](https://forums.foundationdb.org/u/panghy)\
**Post date:** [August 8, 2018, 12:23am UTC](https://forums.foundationdb.org/t/value-too-large-on-reads/615/2 "2018-08-08T00:23:17Z")

</div>

We are also pretty confident that our values are never larger than 100k so it’s odd that it’s failing on reads.

---

<div class="post-metadata">

**Author:** ![alloc](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alloc/32/9_2.png) [@alloc](https://forums.foundationdb.org/u/alloc)\
**Post date:** [August 8, 2018, 12:35am UTC](https://forums.foundationdb.org/t/value-too-large-on-reads/615/3 "2018-08-08T00:35:41Z")

</div>

I wouldn’t expect this to be thrown on reads. We only throw `value_too_large` from four places in our (non-testing) codebase. They are in the atomicOp and set functions of NativeApi.actor.cpp and ReadYourWrites.actor.cpp, neither one of which should be used by a range read.

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [August 8, 2018, 8:00pm UTC](https://forums.foundationdb.org/t/value-too-large-on-reads/615/4 "2018-08-08T20:00:40Z")

</div>

If my reading of `retargetClone()` is right, it copies the error from some other FDBException with the stack trace of the current location. So I don’t think that this is `hasNext()` throwing a `value_too_large`, I think this is `value_too_large` being re-thrown at hasNext.

Unfortunately, your files and line numbers don’t match up with master, so it’s difficult for me to work through the call stack that you have. I’d be interested to know what the future is that you’re calling `.get()` on, because it looks like that future was completed with an error that’s being re-thrown.

There were some semantics changes in 4.x around using transactions after they’ve been committed causing an error?

---

<div class="post-metadata">

**Author:** ![panghy](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/panghy/32/19_2.png) [@panghy](https://forums.foundationdb.org/u/panghy)\
**Post date:** [August 10, 2018, 2:04am UTC](https://forums.foundationdb.org/t/value-too-large-on-reads/615/5 "2018-08-10T02:04:28Z")

</div>

Yeah, we located the issue and it was a retargeted exception. For a while I thought it must be the client-side read cache that was throwing. Thanks for the looking.
