Reverse range reads on the storage server would not pass the specified byte limit to the storage engine but would apply it to the results returned, causing a potentially significant amount of wasted reading.

This commit is contained in:
A.J. Beamon 2020-02-05 11:16:40 -08:00
parent 3f9ff9b209
commit f32d515fda
1 changed files with 1 additions and 1 deletions

View File

@ -1238,7 +1238,7 @@ ACTOR Future<GetKeyValuesReply> readRange( StorageServer* data, Version version,
if (vEnd)
readBegin = std::max( readBegin, vEnd->isClearTo() ? vEnd->getEndKey() : vEnd.key() );
Standalone<VectorRef<KeyValueRef>> atStorageVersion = wait( data->storage.readRange( KeyRangeRef(readBegin, readEnd), limit ) );
Standalone<VectorRef<KeyValueRef>> atStorageVersion = wait( data->storage.readRange( KeyRangeRef(readBegin, readEnd), limit, *pLimitBytes ) );
if (data->storageVersion() > version) throw transaction_too_old();
int prevSize = result.data.size();