From 8ae0d9b73d6c04c0fc0f00460c3f57200181dbfd Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Mon, 13 Jul 2020 10:17:27 -0700 Subject: [PATCH] Resolve merge conflict --- cmake/ConfigureCompiler.cmake | 5 +- fdbrpc/batcher.actor.h | 116 -------------------------- flow/Arena.h | 25 ------ tests/slow/LowLatencyWithFailures.txt | 3 - 4 files changed, 1 insertion(+), 148 deletions(-) delete mode 100644 fdbrpc/batcher.actor.h diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index 20d125fde4..1612fc3e02 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -275,13 +275,10 @@ else() -Wno-undefined-var-template -Wno-tautological-pointer-compare -Wno-format -<<<<<<< HEAD -Wredundant-move -Wpessimizing-move + -Woverloaded-virtual ) -======= - -Woverloaded-virtual) ->>>>>>> master if (USE_CCACHE) add_compile_options( -Wno-register diff --git a/fdbrpc/batcher.actor.h b/fdbrpc/batcher.actor.h deleted file mode 100644 index 14e00f2ac4..0000000000 --- a/fdbrpc/batcher.actor.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * batcher.actor.h - * - * This source file is part of the FoundationDB open source project - * - * Copyright 2013-2018 Apple Inc. and the FoundationDB project authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// When actually compiled (NO_INTELLISENSE), include the generated version of this file. In intellisense use the source version. -#if defined(NO_INTELLISENSE) && !defined(FLOW_BATCHER_ACTOR_G_H) - #define FLOW_BATCHER_ACTOR_G_H - #include "fdbrpc/batcher.actor.g.h" -#elif !defined(FLOW_BATCHER_ACTOR_H) - #define FLOW_BATCHER_ACTOR_H - -#include "fdbrpc/Stats.h" -#include "flow/flow.h" -#include "flow/actorcompiler.h" // This must be the last #include. - -template -void logOnReceive(X x) { } - -void logOnReceive(CommitTransactionRequest x) { - if(x.debugID.present()) - g_traceBatch.addEvent("CommitDebug", x.debugID.get().first(), "MasterProxyServer.batcher"); -} - -template -bool firstInBatch(X x) { return false; } - -bool firstInBatch(CommitTransactionRequest x) { - return x.firstInBatch(); -} - -ACTOR template -Future batcher(PromiseStream, int> > out, FutureStream in, double avgMinDelay, double* avgMaxDelay, double emptyBatchTimeout, int maxCount, int desiredBytes, int maxBytes, Optional> batchStartedStream, int64_t *commitBatchesMemBytesCount, int64_t commitBatchesMemBytesLimit, TaskPriority taskID = TaskPriority::DefaultDelay, Counter* counter = 0) -{ - wait( delayJittered(*avgMaxDelay, taskID) ); // smooth out - // This is set up to deliver even zero-size batches if emptyBatchTimeout elapses, because that's what master proxy wants. The source control history - // contains a version that does not. - - state double lastBatch = 0; - - loop { - state Future timeout; - state std::vector batch; - state int batchBytes = 0; - - if(emptyBatchTimeout <= 0) - timeout = Never(); - else - timeout = delayJittered(emptyBatchTimeout, taskID); - - while (!timeout.isReady() && !(batch.size() == maxCount || batchBytes >= desiredBytes)) { - choose { - when ( X x = waitNext(in) ) { - int bytes = getBytes(x); - // Drop requests if memory is under severe pressure - if (*commitBatchesMemBytesCount + bytes > commitBatchesMemBytesLimit) { - x.reply.sendError(proxy_memory_limit_exceeded()); - TraceEvent(SevWarnAlways, "ProxyCommitBatchMemoryThresholdExceeded").suppressFor(60).detail("CommitBatchesMemBytesCount", *commitBatchesMemBytesCount).detail("CommitBatchesMemLimit", commitBatchesMemBytesLimit); - continue; - } - - // Process requests in the normal case - if (counter) ++*counter; - logOnReceive(x); - if (!batch.size()) { - if(batchStartedStream.present()) - batchStartedStream.get().send(Void()); - if (now() - lastBatch > *avgMaxDelay) - timeout = delayJittered(avgMinDelay, taskID); - else - timeout = delayJittered(*avgMaxDelay - (now() - lastBatch), taskID); - } - - bool first = firstInBatch( x ); - if((batchBytes + bytes > maxBytes || first) && batch.size()) { - out.send({ batch, batchBytes }); - lastBatch = now(); - if(batchStartedStream.present()) - batchStartedStream.get().send(Void()); - timeout = delayJittered(*avgMaxDelay, taskID); - batch = std::vector(); - batchBytes = 0; - } - - batch.push_back(x); - batchBytes += bytes; - *commitBatchesMemBytesCount += bytes; - } - when ( wait( timeout ) ) {} - } - } - out.send({std::move(batch), batchBytes}); - lastBatch = now(); - } -} - -#include "flow/unactorcompiler.h" - -#endif diff --git a/flow/Arena.h b/flow/Arena.h index 79715f8546..2758ae5925 100644 --- a/flow/Arena.h +++ b/flow/Arena.h @@ -175,31 +175,6 @@ private: static void* operator new(size_t s); // not implemented }; -<<<<<<< HEAD -======= -inline Arena::Arena() : impl( NULL ) {} -inline Arena::Arena(size_t reservedSize) : impl( 0 ) { - UNSTOPPABLE_ASSERT( reservedSize < std::numeric_limits::max() ); - if (reservedSize) - ArenaBlock::create((int)reservedSize,impl); -} -inline Arena::Arena( const Arena& r ) : impl( r.impl ) {} -inline Arena::Arena(Arena&& r) noexcept : impl(std::move(r.impl)) {} -inline Arena& Arena::operator=(const Arena& r) { - impl = r.impl; - return *this; -} -inline Arena& Arena::operator=(Arena&& r) noexcept { - impl = std::move(r.impl); - return *this; -} -inline void Arena::dependsOn( const Arena& p ) { - if (p.impl) - ArenaBlock::dependOn( impl, p.impl.getPtr() ); -} -inline size_t Arena::getSize() const { return impl ? impl->totalSize() : 0; } -inline bool Arena::hasFree( size_t size, const void *address ) { return impl && impl->unused() >= size && impl->getNextData() == address; } ->>>>>>> master inline void* operator new ( size_t size, Arena& p ) { UNSTOPPABLE_ASSERT( size < std::numeric_limits::max() ); return ArenaBlock::allocate( p.impl, (int)size ); diff --git a/tests/slow/LowLatencyWithFailures.txt b/tests/slow/LowLatencyWithFailures.txt index e3b92d292a..d171f6ad5b 100644 --- a/tests/slow/LowLatencyWithFailures.txt +++ b/tests/slow/LowLatencyWithFailures.txt @@ -21,9 +21,6 @@ connectionFailuresDisableDuration=60 waitForVersion=true allowFaultInjection=false killDc=false -<<<<<<< HEAD connectionFailuresDisableDuration=60 minimumReplication=2 -======= ->>>>>>> master