From 96641eefd94877b651711e61c5ac04390fc5f81d Mon Sep 17 00:00:00 2001 From: Andrey Kurilov Date: Fri, 13 Oct 2017 09:48:41 +0300 Subject: [PATCH] account only the transferred payload size for concatenation requests --- .../storage/driver/net/http/amzs3/AmzS3StorageDriver.java | 2 +- .../storage/driver/net/http/emc/s3/EmcS3StorageDriver.java | 3 ++- .../emc/mongoose/storage/driver/base/StorageDriverBase.java | 4 +++- .../emc/mongoose/tests/system/ConcatRandomItemRangesTest.java | 4 +--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/storage/driver/net/http/amzs3/src/main/java/com/emc/mongoose/storage/driver/net/http/amzs3/AmzS3StorageDriver.java b/storage/driver/net/http/amzs3/src/main/java/com/emc/mongoose/storage/driver/net/http/amzs3/AmzS3StorageDriver.java index eded9533f2..b29d7bd65a 100644 --- a/storage/driver/net/http/amzs3/src/main/java/com/emc/mongoose/storage/driver/net/http/amzs3/AmzS3StorageDriver.java +++ b/storage/driver/net/http/amzs3/src/main/java/com/emc/mongoose/storage/driver/net/http/amzs3/AmzS3StorageDriver.java @@ -547,7 +547,7 @@ private FullHttpRequest getCompleteMpuRequest( } @Override - public final void complete(final Channel channel, final O ioTask) { + public void complete(final Channel channel, final O ioTask) { if(channel != null && ioTask instanceof CompositeDataIoTask) { final CompositeDataIoTask compositeIoTask = (CompositeDataIoTask) ioTask; if(compositeIoTask.allSubTasksDone()) { diff --git a/storage/driver/net/http/emc/s3/src/main/java/com/emc/mongoose/storage/driver/net/http/emc/s3/EmcS3StorageDriver.java b/storage/driver/net/http/emc/s3/src/main/java/com/emc/mongoose/storage/driver/net/http/emc/s3/EmcS3StorageDriver.java index 80e7fc1f1f..6f9f791b8c 100644 --- a/storage/driver/net/http/emc/s3/src/main/java/com/emc/mongoose/storage/driver/net/http/emc/s3/EmcS3StorageDriver.java +++ b/storage/driver/net/http/emc/s3/src/main/java/com/emc/mongoose/storage/driver/net/http/emc/s3/EmcS3StorageDriver.java @@ -27,6 +27,7 @@ import com.github.akurilov.commons.collection.Range; import com.github.akurilov.commons.math.Random; import io.netty.buffer.Unpooled; +import io.netty.channel.Channel; import io.netty.handler.codec.http.DefaultFullHttpRequest; import io.netty.handler.codec.http.DefaultHttpHeaders; import io.netty.handler.codec.http.EmptyHttpHeaders; @@ -433,7 +434,7 @@ private FullHttpRequest getCopyRangesRequest( // set the total summary size for the destination item dstItem.size(dstItemSize); - dataIoTask.setCountBytesDone(dstItemSize); + dataIoTask.setCountBytesDone(content.length()); // request headers final HttpHeaders httpHeaders = new DefaultHttpHeaders(); diff --git a/storage/driver/src/main/java/com/emc/mongoose/storage/driver/base/StorageDriverBase.java b/storage/driver/src/main/java/com/emc/mongoose/storage/driver/base/StorageDriverBase.java index 26ef2fac61..8d3a35079c 100644 --- a/storage/driver/src/main/java/com/emc/mongoose/storage/driver/base/StorageDriverBase.java +++ b/storage/driver/src/main/java/com/emc/mongoose/storage/driver/base/StorageDriverBase.java @@ -277,7 +277,9 @@ protected final void ioTaskCompleted(final O ioTask) { final O ioTaskResult = ioTask.getResult(); if(!ioResultsQueue.offer(ioTaskResult/*, 1, TimeUnit.MICROSECONDS*/)) { - Loggers.ERR.warn("{}: I/O task results queue overflow, dropping the result", toString()); + Loggers.ERR.warn( + "{}: I/O task results queue overflow, dropping the result", toString() + ); } if(ioTask instanceof CompositeIoTask) { diff --git a/tests/system/src/test/java/com/emc/mongoose/tests/system/ConcatRandomItemRangesTest.java b/tests/system/src/test/java/com/emc/mongoose/tests/system/ConcatRandomItemRangesTest.java index 6a9cf8dfa7..b0286bf01d 100644 --- a/tests/system/src/test/java/com/emc/mongoose/tests/system/ConcatRandomItemRangesTest.java +++ b/tests/system/src/test/java/com/emc/mongoose/tests/system/ConcatRandomItemRangesTest.java @@ -91,9 +91,7 @@ public final void test() final LongAdder ioTraceRecCount = new LongAdder(); final SizeInBytes avgDstItemContentSize = new SizeInBytes( - SRC_ITEMS_TO_CONCAT_MIN * SRC_ITEMS_RANDOM_RANGES_COUNT, - SRC_ITEMS_TO_CONCAT_MAX * SRC_ITEMS_RANDOM_RANGES_COUNT * itemSize.getValue().get() / 2, - 1 + SRC_ITEMS_TO_CONCAT_MIN * 100, SRC_ITEMS_TO_CONCAT_MAX * 200, 1 ); final Consumer ioTraceReqTestFunc = ioTraceRec -> { testIoTraceRecord(ioTraceRec, IoType.CREATE.ordinal(), avgDstItemContentSize);